aboutsummaryrefslogtreecommitdiff
path: root/javascript/olm_pre.js
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2015-12-02 14:06:01 +0000
committerRichard van der Hoff <richard@matrix.org>2015-12-02 14:06:01 +0000
commita5fe3f605a6b972c4c9df0b4d36a35628fb131c8 (patch)
tree24140b7461a76ef51b19fd3e4396923bca9f16b6 /javascript/olm_pre.js
parent2bb7f3b1e6d7735d1f03f332c57c34dc81ae88c2 (diff)
Fix a console error when importing in a browser
something about 'global' not defined
Diffstat (limited to 'javascript/olm_pre.js')
-rw-r--r--javascript/olm_pre.js2
1 files changed, 1 insertions, 1 deletions
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;