From a76808e72ec709ed292990b35e3428dcf4188517 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Fri, 25 Jul 2014 00:18:27 -0400 Subject: [PATCH] Tracker: Unchecked dynamic_cast in FilePanelPriv.cpp, CID 300327 --- src/kits/tracker/FilePanelPriv.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/kits/tracker/FilePanelPriv.cpp b/src/kits/tracker/FilePanelPriv.cpp index b50a3dc43b..725df9ef65 100644 --- a/src/kits/tracker/FilePanelPriv.cpp +++ b/src/kits/tracker/FilePanelPriv.cpp @@ -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(FindView("text view")); - textControl->SetText(text); - textControl->TextView()->SelectAll(); + if (textControl != NULL) { + textControl->SetText(text); + if (textControl->TextView() != NULL) + textControl->TextView()->SelectAll(); + } }