From 5529e8d2df01f790159db24eabd6661cac2fba08 Mon Sep 17 00:00:00 2001 From: Murai Takashi Date: Sun, 26 Jan 2020 19:45:38 +0900 Subject: [PATCH] deskbar: Fix PVS V757 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use dynamic_cast to menuItem after NULL checking to it. Change-Id: I3fdabf5a091922587f498cf5fa116f8824bbfc6b Reviewed-on: https://review.haiku-os.org/c/haiku/+/2160 Reviewed-by: Adrien Destugues Reviewed-by: Jérôme Duval --- src/apps/deskbar/ExpandoMenuBar.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/apps/deskbar/ExpandoMenuBar.cpp b/src/apps/deskbar/ExpandoMenuBar.cpp index dad7a02672..36fac162c7 100644 --- a/src/apps/deskbar/ExpandoMenuBar.cpp +++ b/src/apps/deskbar/ExpandoMenuBar.cpp @@ -351,8 +351,6 @@ TExpandoMenuBar::MouseMoved(BPoint where, uint32 code, const BMessage* message) { BMenuItem* menuItem; TTeamMenuItem* item = TeamItemAtPoint(where, &menuItem); - TWindowMenuItem* windowMenuItem - = dynamic_cast(menuItem); if (item == NULL || menuItem == NULL) { // item is NULL, remove the tooltip and break out @@ -366,6 +364,9 @@ TExpandoMenuBar::MouseMoved(BPoint where, uint32 code, const BMessage* message) break; } + TWindowMenuItem* windowMenuItem + = dynamic_cast(menuItem); + if (windowMenuItem != NULL && fBarView->Vertical() && fBarView->ExpandoState() && item->IsExpanded()) { // expando mode window menu item