--- dao/DaoAdresseVedligehold/src/main/java/dk/daoas/adressevedligehold/AddressSourceBK.java 2016/01/28 10:57:26 2860 +++ dao/DaoAdresseVedligehold/src/main/java/dk/daoas/adressevedligehold/AddressSourceBK.java 2016/01/28 11:03:14 2861 @@ -44,10 +44,15 @@ BufferedReader br1 = new BufferedReader(isr1) ) { String line = br1.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 != 13) { - throw new IOException("Not enough fields in CSV file. Found " + numFields + ", expected 13"); + + if (parts.length != 13) { + throw new IOException("Not enough fields in CSV file. Found " + parts.length + ", expected 13"); } }