Better to use `$file!==null` to be consistent with the rest of the code.