Tracker: Unchecked dynamic_cast, CID 500345

This commit is contained in:
John Scipione 2014-07-24 21:57:50 -04:00
parent d6e0dbfe30
commit 35237fd8f3

View File

@ -3130,14 +3130,13 @@ DraggableQueryIcon::DragStarted(BMessage* dragMessage)
dragMessage->RemoveData("be:clip_name");
FindWindow* window = dynamic_cast<FindWindow*>(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;
}