Skip to content

Commit dd99b7e

Browse files
johnfabreJohn Erwin Fabre
authored and
John Erwin Fabre
committed
Use optional chaining when retrieving NODE_ENV
this will fix the issue where globalThis.process.env is undefined and it is still trying to retrieve NODE_ENV
1 parent 9c90a23 commit dd99b7e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/jsutils/instanceOf.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { inspect } from './inspect.js';
99
export const instanceOf: (value: unknown, constructor: Constructor) => boolean =
1010
/* c8 ignore next 6 */
1111
// FIXME: https://github.com/graphql/graphql-js/issues/2317
12-
globalThis.process != null && globalThis.process.env.NODE_ENV === 'production'
12+
globalThis.process != null && globalThis.process.env != null && globalThis.process.env.NODE_ENV === 'production'
1313
? function instanceOf(value: unknown, constructor: Constructor): boolean {
1414
return value instanceof constructor;
1515
}

0 commit comments

Comments
 (0)