From 35237fd8f3ff9c25f3dcb607f3d04c164fba18ea Mon Sep 17 00:00:00 2001 From: John Scipione Date: Thu, 24 Jul 2014 21:57:50 -0400 Subject: [PATCH] Tracker: Unchecked dynamic_cast, CID 500345 --- src/kits/tracker/FindPanel.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/kits/tracker/FindPanel.cpp b/src/kits/tracker/FindPanel.cpp index fdee482516..0ae89636b7 100644 --- a/src/kits/tracker/FindPanel.cpp +++ b/src/kits/tracker/FindPanel.cpp @@ -3130,14 +3130,13 @@ DraggableQueryIcon::DragStarted(BMessage* dragMessage) dragMessage->RemoveData("be:clip_name"); FindWindow* window = dynamic_cast(Window()); - dragMessage->AddString("be:clip_name", - window->BackgroundView()->UserSpecifiedName() ? - window->BackgroundView()->UserSpecifiedName() - : B_TRANSLATE("New Query")); - return true; ASSERT(window != NULL); + return window != NULL && dragMessage->AddString("be:clip_name", + window->BackgroundView()->UserSpecifiedName() != NULL + ? window->BackgroundView()->UserSpecifiedName() + : B_TRANSLATE("New Query")) == B_OK; }