From ffeeddb37a4146e6a66dea54bb13f316c778c675 Mon Sep 17 00:00:00 2001
From: David Sehnal <david.sehnal@gmail.com>
Date: Mon, 2 Nov 2020 21:02:10 +0100
Subject: [PATCH] debug.ts tweak

---
 src/mol-util/debug.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mol-util/debug.ts b/src/mol-util/debug.ts
index b96d6fb06..72b7657b2 100644
--- a/src/mol-util/debug.ts
+++ b/src/mol-util/debug.ts
@@ -8,13 +8,13 @@
  * on node `process.env.NODE_ENV` is available, in webpack build it is automatically set
  * by the DefinePlugin to the webpack `mode` value
  */
-let isProductionMode = process.env.NODE_ENV === 'production';
+let isProductionMode = typeof process !== 'undefined' && process.env?.NODE_ENV === 'production';
 
 /**
  * set to true to enable more comprehensive checks and assertions,
  * mostly used in `mol-gl` and in valence-model calculation
  */
-let isDebugMode = process.env.DEBUG === '*' || process.env.DEBUG === 'molstar';
+let isDebugMode = typeof process !== 'undefined' && (process.env?.DEBUG === '*' || process.env?.DEBUG === 'molstar');
 
 export { isProductionMode, isDebugMode };
 
-- 
GitLab