From 6a27de893b6c641cef9e5cff45f781ab8c0a854c Mon Sep 17 00:00:00 2001 From: Murai Takashi Date: Sun, 26 Jan 2020 20:20:23 +0900 Subject: [PATCH] deskbar Fix PVS V595 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add NULL check for 'fBarView', since it might be NULL at line 107. Change-Id: I293e551dd4ab6ac33b7d4a6d1bf736bcd142cb80 Reviewed-on: https://review.haiku-os.org/c/haiku/+/2170 Reviewed-by: Jérôme Duval --- src/apps/deskbar/TeamMenuItem.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/apps/deskbar/TeamMenuItem.cpp b/src/apps/deskbar/TeamMenuItem.cpp index 6fcecd8a56..1c1fd1f740 100644 --- a/src/apps/deskbar/TeamMenuItem.cpp +++ b/src/apps/deskbar/TeamMenuItem.cpp @@ -96,16 +96,18 @@ TTeamMenuItem::~TTeamMenuItem() status_t TTeamMenuItem::Invoke(BMessage* message) { - if (fBarView->InvokeItem(Signature())) { - // handles drop on application - return B_OK; - } + if (fBarView != NULL) { + if (fBarView->InvokeItem(Signature())) { + // handles drop on application + return B_OK; + } - // if the app could not handle the drag message - // and we were dragging, then kill the drag - // should never get here, disabled item will not invoke - if (fBarView != NULL && fBarView->Dragging()) - fBarView->DragStop(); + // if the app could not handle the drag message + // and we were dragging, then kill the drag + // should never get here, disabled item will not invoke + if (fBarView->Dragging()) + fBarView->DragStop(); + } // bring to front or minimize shortcuts uint32 mods = modifiers();