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
1 changed files with 6 additions and 3 deletions

View File

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