Unverified Commit 63b7bab4 authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #942 from ethereum/yann300-patch-23

Check if `navigator` available
parents a46e359f c12002be
...@@ -73,7 +73,7 @@ function Compiler (handleImportCall) { ...@@ -73,7 +73,7 @@ function Compiler (handleImportCall) {
function onInternalCompilerLoaded () { function onInternalCompilerLoaded () {
if (worker === null) { if (worker === null) {
var compiler var compiler
var userAgent = navigator.userAgent.toLowerCase() var userAgent = (typeof (navigator) != 'undefined') && navigator.userAgent ? navigator.userAgent.toLowerCase() : "-"
if (typeof (window) === 'undefined' || userAgent.indexOf(' electron/') > -1) { if (typeof (window) === 'undefined' || userAgent.indexOf(' electron/') > -1) {
compiler = require('solc') compiler = require('solc')
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment