From 1fd2422623db6e413054c79931cd4391598c9a1c Mon Sep 17 00:00:00 2001 From: bas-d <7903735+bas-d@users.noreply.github.com> Date: Sun, 12 May 2019 13:04:11 +0200 Subject: [PATCH] Properly check if console exists. --- dist-build/emscripten.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist-build/emscripten.sh b/dist-build/emscripten.sh index f5de28d9..4dfd899b 100755 --- a/dist-build/emscripten.sh +++ b/dist-build/emscripten.sh @@ -100,12 +100,12 @@ if [ "$DIST" = yes ]; then var Module = _Module; Module.onAbort = reject; Module.print = function(what) { - if (console != null) { + if (typeof(console) !== 'undefined') { console.log(what); } } Module.printErr = function(what) { - if (console != null) { + if (typeof(console) !== 'undefined') { console.warn(what); } }