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,16 +179,18 @@ 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);
} else { } else {
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;
} }