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
This commit is contained in:
Stefano Ceccherini 2006-07-04 12:37:59 +00:00
parent 955bc004af
commit 9d9c1564b8

View File

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