diff --git a/src/kits/tracker/Model.cpp b/src/kits/tracker/Model.cpp index 1cf77c84ca..e4607ad5a6 100644 --- a/src/kits/tracker/Model.cpp +++ b/src/kits/tracker/Model.cpp @@ -1109,12 +1109,14 @@ Model::SupportsMimeType(const char* type, const BObjectList* list, if (type) { BString typeString(type); match = MatchMimeTypeString(&typeString, mimeSignature); - } else - match = WhileEachListItem(const_cast*>(list), - MatchMimeTypeString, mimeSignature); - // const_cast shouldnt be here, have to have it until - // MW cleans up - + } else { + if (list != NULL && !list->IsEmpty()) { + match = WhileEachListItem(const_cast*>(list), + MatchMimeTypeString, mimeSignature); + } + // const_cast shouldnt be here, have to have it until + // MW cleans up + } if (match == kMatch) // supports the actual type, it can't get any better return kModelSupportsType; diff --git a/src/kits/tracker/NavMenu.cpp b/src/kits/tracker/NavMenu.cpp index 4dc61778d3..14578f5ea0 100644 --- a/src/kits/tracker/NavMenu.cpp +++ b/src/kits/tracker/NavMenu.cpp @@ -130,7 +130,7 @@ void SpringLoadedFolderSetMenuStates(const BMenu* menu, const BObjectList* typeslist) { - if (!menu || !typeslist) + if (!menu || !typeslist || typeslist->IsEmpty()) return; // if a types list exists @@ -339,13 +339,6 @@ BNavMenu::AttachedToWindow() void BNavMenu::DetachedFromWindow() { - // does this need to set this to null? - // the parent, handling dnd should set this - // appropriately - // - // if this changes, BeMenu and RecentsMenu - // in Deskbar should also change - fTypesList = NULL; } @@ -819,7 +812,10 @@ BNavMenu::SetShowParent(bool show) void BNavMenu::SetTypesList(const BObjectList* list) { - *fTypesList = *list; + if (list != NULL) + *fTypesList = *list; + else + fTypesList->MakeEmpty(); }