fix NullPointerException when domaincode directory is empty

fixes issue #1