From 3a6347a1329f6d61e64d6815552a3f3ebe98769d Mon Sep 17 00:00:00 2001 From: Raphael Jolly Date: Fri, 25 Aug 2017 18:26:12 +0200 Subject: [PATCH] empty --- .../src/main/java/linoleum/application/ScriptSupport.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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); } }