Fixes #1530. Fixes NPE by using IO.listFiles
Merge pull request #1533 from sbt/fix/1530

Fixes #1530. Fixes NPE by using IO.listFiles