Commit c12002be authored by 0mkar's avatar 0mkar

check navigator in node env

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