From 4b695ba06c14fae89e2eded704816a23a8f4bf87 Mon Sep 17 00:00:00 2001 From: GaidamakUA Date: Wed, 30 Mar 2016 11:30:47 +0300 Subject: [PATCH] Fixed introduced crash. --- OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java b/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java index 7916a69ab4..5d6329d784 100644 --- a/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java +++ b/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java @@ -154,9 +154,9 @@ public class ContextMenuAdapter { tv.setCompoundDrawables(imageId, null, null, null); tv.setCompoundDrawablePadding(paddingInPixels); } else { - Drawable drawable = ContextCompat.getDrawable(getContext(), item.getLightIcon()); - DrawableCompat.setTint(drawable, item.getThemedColor(getContext())); - if (drawable != null) { + if (item.getLightIcon() != -1) { + Drawable drawable = ContextCompat.getDrawable(getContext(), item.getLightIcon()); + DrawableCompat.setTint(drawable, item.getThemedColor(getContext())); ((AppCompatImageView) convertView.findViewById(R.id.icon)).setImageDrawable(drawable); convertView.findViewById(R.id.icon).setVisibility(View.VISIBLE); } else if (convertView.findViewById(R.id.icon) != null) {