diff --git a/src/main/java/net/sf/jabref/exporter/SaveActions.java b/src/main/java/net/sf/jabref/exporter/SaveActions.java index 4c034a601c8..435d9061180 100644 --- a/src/main/java/net/sf/jabref/exporter/SaveActions.java +++ b/src/main/java/net/sf/jabref/exporter/SaveActions.java @@ -21,18 +21,23 @@ public class SaveActions { public SaveActions(MetaData metaData) { actions = new HashMap<>(); - List formatters = metaData.getData(META_KEY); setAvailableFormatters(); - for (int i = 0; i < formatters.size(); i += 2) { - try { - String field = formatters.get(i); - Formatter formatter = getFormatterFromString(formatters.get(i + 1)); - - actions.put(field, formatter); - } catch(IndexOutOfBoundsException e){ - // the meta data string in the file is broken. -> Ignore the last item - break; + List formatters = metaData.getData(META_KEY); + if(formatters==null) { + // no save actions defined in the meta data + return; + } else { + for (int i = 0; i < formatters.size(); i += 2) { + try { + String field = formatters.get(i); + Formatter formatter = getFormatterFromString(formatters.get(i + 1)); + + actions.put(field, formatter); + } catch (IndexOutOfBoundsException e) { + // the meta data string in the file is broken. -> Ignore the last item + break; + } } }