Fix QuickSearchListItem crash
This commit is contained in:
parent
b9ef55ec23
commit
e402edfef9
1 changed files with 8 additions and 4 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue