diff --git a/lib/arguments/file-url.js b/lib/arguments/file-url.js index 0a0bde317..e7a8560b5 100644 --- a/lib/arguments/file-url.js +++ b/lib/arguments/file-url.js @@ -7,7 +7,7 @@ export const safeNormalizeFileUrl = (file, name) => { const isString = typeof fileString === 'string' // In Deno node:process execPath is a special object, not just a string: // https://github.com/denoland/deno/blob/f460188e583f00144000aa0d8ade08218d47c3c1/ext/node/polyfills/process.ts#L344 - || Object.getPrototypeOf(fileString) === String.prototype; + || (fileString && Object.getPrototypeOf(fileString) === String.prototype); if (!isString) { throw new TypeError(`${name} must be a string or a file URL: ${fileString}.`);