From f679edb6e407218ca7efb9611a6ffe9efc2c8e5f Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Sun, 14 Sep 2008 17:51:13 +0000 Subject: [PATCH] Don't build the context menu before checking for NULL. Fixes CID 1077, though the Tracker sources should really be cleaned up to use nothrow and/or exception handling more consistently. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27504 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/tracker/InfoWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kits/tracker/InfoWindow.cpp b/src/kits/tracker/InfoWindow.cpp index 8e74c68f9f..6673e0cd7e 100644 --- a/src/kits/tracker/InfoWindow.cpp +++ b/src/kits/tracker/InfoWindow.cpp @@ -1242,8 +1242,8 @@ AttributeView::MouseDown(BPoint point) if (((modifiers() & B_CONTROL_KEY) != 0) || (buttons & B_SECONDARY_MOUSE_BUTTON) != 0) { // Show contextual menu BPopUpMenu *contextMenu = new BPopUpMenu("FileContext", false, false); - BuildContextMenu(contextMenu); if (contextMenu) { + BuildContextMenu(contextMenu); contextMenu->SetAsyncAutoDestruct(true); contextMenu->Go(ConvertToScreen(point), true, true, ConvertToScreen(fIconRect)); }