--- dao/DaoAdresseVedligehold/src/main/java/dk/daoas/adressevedligehold/AddressSourceFD.java 2016/01/26 22:24:13 2852 +++ dao/DaoAdresseVedligehold/src/main/java/dk/daoas/adressevedligehold/AddressSourceFD.java 2016/01/28 11:03:14 2861 @@ -48,10 +48,14 @@ br = new BufferedReader(isr); String line = br.readLine(); + + if (line == null) { + throw new IOException("Can't read 1st line - is file empty?"); + } + String[] parts = line.split(";"); - int numFields = parts.length; - if (numFields != 9) { - throw new IOException("Not enough fields in CSV file. Found " + numFields + ", expected 9"); + if (parts.length != 9) { + throw new IOException("Not enough fields in CSV file. Found " + parts.length + ", expected 9"); }