NPE on empty directory

Use listFiles variable instead of calling again File.listFiles