check if `navigator` available

pull/7/head
yann300 6 years ago committed by GitHub
parent a46e359f8a
commit b01738112b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      remix-solidity/src/compiler/compiler.js

@ -73,7 +73,7 @@ function Compiler (handleImportCall) {
function onInternalCompilerLoaded () {
if (worker === null) {
var compiler
var userAgent = navigator.userAgent.toLowerCase()
var userAgent = navigator && navigator.userAgent ? navigator.userAgent.toLowerCase() : "-"
if (typeof (window) === 'undefined' || userAgent.indexOf(' electron/') > -1) {
compiler = require('solc')
} else {

Loading…
Cancel
Save