From 9d9c1564b8297e61710cd7fda9e2ba7b994739ff Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Tue, 4 Jul 2006 12:37:59 +0000 Subject: [PATCH] One of the BMenu::AddItem() variations crashed if the passed item was NULL. Fixes bug 465 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18026 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Menu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kits/interface/Menu.cpp b/src/kits/interface/Menu.cpp index eaa490c8b8..69b4e321d8 100644 --- a/src/kits/interface/Menu.cpp +++ b/src/kits/interface/Menu.cpp @@ -343,7 +343,7 @@ BMenu::AddItem(BMenuItem *item, int32 index) debugger("BMenu::AddItem(BMenuItem *, int32) this method can only " "be called if the menu layout is not B_ITEMS_IN_MATRIX"); - if (!_AddItem(item, index)) + if (!item || !_AddItem(item, index)) return false; InvalidateLayout();