throw error on file.contents null.