Tracker: Unchecked dynamic_cast in FilePanelPriv.cpp, CID 300327

This commit is contained in:
John Scipione 2014-07-25 00:18:27 -04:00
parent e5355e2814
commit a76808e72e

View File

@ -1075,13 +1075,16 @@ TFilePanel::SetButtonLabel(file_panel_button selector, const char* text)
void void
TFilePanel::SetSaveText(const char* text) TFilePanel::SetSaveText(const char* text)
{ {
if (!text) if (text == NULL)
return; return;
BTextControl* textControl BTextControl* textControl
= dynamic_cast<BTextControl*>(FindView("text view")); = dynamic_cast<BTextControl*>(FindView("text view"));
textControl->SetText(text); if (textControl != NULL) {
textControl->TextView()->SelectAll(); textControl->SetText(text);
if (textControl->TextView() != NULL)
textControl->TextView()->SelectAll();
}
} }