From a5fe3f605a6b972c4c9df0b4d36a35628fb131c8 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 2 Dec 2015 14:06:01 +0000 Subject: [PATCH] Fix a console error when importing in a browser something about 'global' not defined --- javascript/olm_pre.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/olm_pre.js b/javascript/olm_pre.js index 7706687..50bf8c2 100644 --- a/javascript/olm_pre.js +++ b/javascript/olm_pre.js @@ -2,7 +2,7 @@ var olm_exports = {}; var get_random_values; var process; // Shadow the process object so that emscripten won't get // confused by browserify -if (global && global["window"]) { +if (typeof(global) !== 'undefined' && global["window"]) { // We're running with browserify module["exports"] = olm_exports; global["window"]["Olm"] = olm_exports;