diff --git a/application/src/main/java/linoleum/application/ScriptSupport.java b/application/src/main/java/linoleum/application/ScriptSupport.java index c8fb8d3b..c5ca12e9 100644 --- a/application/src/main/java/linoleum/application/ScriptSupport.java +++ b/application/src/main/java/linoleum/application/ScriptSupport.java @@ -88,10 +88,11 @@ protected void load() { @Override protected void save() { - prefs.put(getKey("language"), getLanguageName()); + prefs.put(getKey("language"), getSelectedLanguage()); } - protected String getLanguageName() { - return factoriesByName.get(model.getSelectedItem()).getNames().get(0); + protected String getSelectedLanguage() { + final ScriptEngineFactory factory = factoriesByName.get(model.getSelectedItem()); + return factory == null?null:factory.getNames().get(0); } }