fix an error triggered by a null value returned from readFile