Fixed nullpointer when file is left empty