Fix crash due to null object when file is not supported