diff --git a/source/net/filebot/format/ExpressionFormatFunctions.java b/source/net/filebot/format/ExpressionFormatFunctions.java index 24f8025a..3c013e2f 100644 --- a/source/net/filebot/format/ExpressionFormatFunctions.java +++ b/source/net/filebot/format/ExpressionFormatFunctions.java @@ -88,11 +88,13 @@ public class ExpressionFormatFunctions { return obj; } - public Map csv(String path) throws IOException { + public static Map csv(String path) throws IOException { Map map = new LinkedHashMap(); for (String line : Files.readAllLines(Paths.get(path), Charset.forName("UTF-8"))) { String[] field = line.split(";", 2); - map.put(field[0], field[1]); + if (field.length >= 2) { + map.put(field[0], field[1]); + } } return map; }