From 2b3230501c86ad9821a590759775e83a9f351e1e Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 16 Feb 2013 16:10:46 +0100 Subject: [PATCH] Fix exceptions --- OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java b/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java index e0f883e7fb..2e95710306 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java @@ -7,6 +7,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.EnumSet; import java.util.LinkedHashSet; +import java.util.List; import java.util.Set; import net.osmand.access.AccessibleToast; @@ -317,14 +318,18 @@ public class MapInfoLayer extends OsmandMapLayer { } }); - createCustomRenderingProperties(app.getRendererRegistry().getCurrentSelectedRenderer()); + RenderingRulesStorage renderer = app.getRendererRegistry().getCurrentSelectedRenderer(); + if(renderer != null) { + createCustomRenderingProperties(renderer); + } } private void createCustomRenderingProperties(RenderingRulesStorage renderer) { String categoryName = ADDITIONAL_VECTOR_RENDERING_CATEGORY; mapInfoControls.removeApperanceWidgets(categoryName); final OsmandApplication app = view.getApplication(); - for (final RenderingRuleProperty p : renderer.PROPS.getCustomRules()) { + List customRules = renderer.PROPS.getCustomRules(); + for (final RenderingRuleProperty p : customRules) { String propertyName = SettingsActivity.getStringPropertyName(view.getContext(), p.getAttrName(), p.getName()); //test old descr as title final String propertyDescr = SettingsActivity.getStringPropertyDescription(view.getContext(), p.getAttrName(), p.getName());