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
This commit is contained in:
Michael Lotz 2008-09-14 17:51:13 +00:00
parent 7aafe66984
commit f679edb6e4

View File

@ -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));
}