Missing null-or-empty check for 'file'