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:
Rene Gollent 2010-07-31 18:39:34 +00:00
parent 62ffe41831
commit 8d50f4a598

View File

@ -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