fix NullPointerException when domaincode directory is empty