Unverified Commit b0173811 authored by yann300's avatar yann300 Committed by GitHub

check if `navigator` available

parent a46e359f
...@@ -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 = navigator && 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