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:
parent
955bc004af
commit
9d9c1564b8
@ -343,7 +343,7 @@ BMenu::AddItem(BMenuItem *item, int32 index)
|
|||||||
debugger("BMenu::AddItem(BMenuItem *, int32) this method can only "
|
debugger("BMenu::AddItem(BMenuItem *, int32) this method can only "
|
||||||
"be called if the menu layout is not B_ITEMS_IN_MATRIX");
|
"be called if the menu layout is not B_ITEMS_IN_MATRIX");
|
||||||
|
|
||||||
if (!_AddItem(item, index))
|
if (!item || !_AddItem(item, index))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
InvalidateLayout();
|
InvalidateLayout();
|
||||||
|
Loading…
Reference in New Issue
Block a user