From d4217e34b6fe0e449761f2f498c3586e52c622d2 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 15 Apr 2018 00:39:00 +0200 Subject: [PATCH] Remove crash caused by renaming styles --- .../src/net/osmand/plus/render/RendererRegistry.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/render/RendererRegistry.java b/OsmAnd/src/net/osmand/plus/render/RendererRegistry.java index 734dcc3eaf..f651b8ccc8 100644 --- a/OsmAnd/src/net/osmand/plus/render/RendererRegistry.java +++ b/OsmAnd/src/net/osmand/plus/render/RendererRegistry.java @@ -179,16 +179,18 @@ public class RendererRegistry { } if(externalRenderers.containsKey(name)){ is = new FileInputStream(externalRenderers.get(name)); - } else if(internalRenderers.containsKey(name)){ + } else { + if (!internalRenderers.containsKey(name)) { + log.error("Rendering style not found: " + name); + name = DEFAULT_RENDER; + } File fl = getFileForInternalStyle(name); - if(fl.exists()) { + if (fl.exists()) { is = new FileInputStream(fl); } else { copyFileForInternalStyle(name); is = RenderingRulesStorage.class.getResourceAsStream(internalRenderers.get(name)); } - } else { - throw new IllegalArgumentException("Not found " + name); //$NON-NLS-1$ } return is; }