NewModelItem can potentially return NULL in a number of cases, which wasn't checked for. Don't try to add them or otherwise manipulate them in such a case. Fixes CID 641.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37828 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
62ffe41831
commit
8d50f4a598
@ -165,6 +165,9 @@ FavoritesMenu::AddNextItem()
|
||||
BMenuItem *item = BNavMenu::NewModelItem(&model,
|
||||
model.IsDirectory() ? fOpenFolderMessage : fOpenFileMessage,
|
||||
fTarget);
|
||||
|
||||
if (item == NULL)
|
||||
return true;
|
||||
|
||||
item->SetLabel(ref.name); // this is the name of the link in the Go dir
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user