Remove crash caused by renaming styles

This commit is contained in:
Victor Shcherb 2018-04-15 00:39:00 +02:00
parent 6b3b1ec5ca
commit d4217e34b6

View file

@ -179,7 +179,11 @@ public class RendererRegistry {
} }
if(externalRenderers.containsKey(name)){ if(externalRenderers.containsKey(name)){
is = new FileInputStream(externalRenderers.get(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); File fl = getFileForInternalStyle(name);
if (fl.exists()) { if (fl.exists()) {
is = new FileInputStream(fl); is = new FileInputStream(fl);
@ -187,8 +191,6 @@ public class RendererRegistry {
copyFileForInternalStyle(name); copyFileForInternalStyle(name);
is = RenderingRulesStorage.class.getResourceAsStream(internalRenderers.get(name)); is = RenderingRulesStorage.class.getResourceAsStream(internalRenderers.get(name));
} }
} else {
throw new IllegalArgumentException("Not found " + name); //$NON-NLS-1$
} }
return is; return is;
} }