Fix QuickSearchListItem crash

This commit is contained in:
Alexey Kulish 2016-11-19 17:21:32 +03:00
parent b9ef55ec23
commit e402edfef9

View file

@ -321,7 +321,7 @@ public class QuickSearchListItem {
iconId = R.drawable.mx_user_defined;
}
}
if (iconId != -1) {
if (iconId > 0) {
return app.getIconsCache().getIcon(iconId,
app.getSettings().isLightContent() ? R.color.osmand_orange : R.color.osmand_orange_dark);
} else {
@ -332,8 +332,12 @@ public class QuickSearchListItem {
String id = getAmenityIconName(amenity);
if (id != null) {
iconId = RenderingIcons.getBigIconResourceId(id);
return app.getIconsCache().getIcon(iconId,
app.getSettings().isLightContent() ? R.color.osmand_orange : R.color.osmand_orange_dark);
if (iconId > 0) {
return app.getIconsCache().getIcon(iconId,
app.getSettings().isLightContent() ? R.color.osmand_orange : R.color.osmand_orange_dark);
} else {
return null;
}
} else {
return null;
}
@ -356,7 +360,7 @@ public class QuickSearchListItem {
iconId = app.getResources().getIdentifier(iconName, "drawable", app.getPackageName());
}
}
if (iconId == -1) {
if (iconId <= 0) {
return app.getIconsCache().getIcon(SearchHistoryFragment.getItemIcon(entry.getName()),
app.getSettings().isLightContent() ? R.color.osmand_orange : R.color.osmand_orange_dark);
} else {