HaikuDepot: Handle NULL PackageInfoRef in FeaturedPackagesView::Select()

This commit is contained in:
Stephan Aßmus 2014-12-26 22:40:24 +01:00
parent 7b434ea483
commit ede65a8f9b

View File

@ -327,13 +327,17 @@ FeaturedPackagesView::Clear()
void
FeaturedPackagesView::SelectPackage(const PackageInfoRef& package)
{
BString selectedTitle;
if (package.Get() != NULL)
selectedTitle = package->Title();
for (int32 i = 0; BLayoutItem* item = fPackageListLayout->ItemAt(i); i++) {
PackageView* view = dynamic_cast<PackageView*>(item->View());
if (view == NULL)
break;
BString title = view->PackageTitle();
view->SetSelected(title == package->Title());
view->SetSelected(title == selectedTitle);
}
}