Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,15 @@ function load() {
}

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