From 646c0cfd4621a04f7814fb29b75c9712e985cf0e Mon Sep 17 00:00:00 2001 From: bas-d <7903735+bas-d@users.noreply.github.com> Date: Sun, 12 May 2019 12:41:55 +0200 Subject: [PATCH] Check if console is null or undefined. --- dist-build/emscripten.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dist-build/emscripten.sh b/dist-build/emscripten.sh index fb810781..f5de28d9 100755 --- a/dist-build/emscripten.sh +++ b/dist-build/emscripten.sh @@ -100,10 +100,14 @@ if [ "$DIST" = yes ]; then var Module = _Module; Module.onAbort = reject; Module.print = function(what) { - console.log(what); + if (console != null) { + console.log(what); + } } Module.printErr = function(what) { - console.warn(what); + if (console != null) { + console.warn(what); + } } Module.onRuntimeInitialized = function() { try {