From a451de436b12db6be040909e1f44f30ff3c49b6f Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 5 Jul 2014 13:11:57 +0000 Subject: [PATCH] * fix csv() function not visible in Expression Format issue --- source/net/filebot/format/ExpressionFormatFunctions.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; }