Skip to content

Commit

Permalink
Browser throw process.env is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
aylanbrown committed Sep 4, 2019
1 parent 6df7bd3 commit 60e443b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,14 @@ function load() {

// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
// process.env is undefined in sometimes, and it will throw a exception
if (!r && typeof process !== 'undefined' && process.env) {
r = process.env.DEBUG;

This comment has been minimized.

Copy link
@P0637

P0637 Sep 25, 2019

Debug undefined

try {
if (!r && typeof process !== 'undefined' && 'env' in process) {
r = process.env.DEBUG;
}
} catch(error) {
// Browser throw `process.env is undefined`
}


return r;
}
Expand Down

0 comments on commit 60e443b

Please sign in to comment.