From 7ba1f8d7b37efa19d206459f2a2c994ea3824b3d Mon Sep 17 00:00:00 2001 From: Anders Evenrud Date: Tue, 22 Aug 2017 23:11:20 +0200 Subject: [PATCH] client: Revert to a default promise on Extension init --- src/client/javascript/core/init.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client/javascript/core/init.js b/src/client/javascript/core/init.js index c612c322ce..90ce447294 100644 --- a/src/client/javascript/core/init.js +++ b/src/client/javascript/core/init.js @@ -261,7 +261,12 @@ const initExtensions = (config) => new Promise((resolve, reject) => { return new Promise((yes, no) => { try { const m = packages[entry]; - OSjs.Extensions[entry].init(m).then(yes).catch((err) => { + let promise = OSjs.Extensions[entry].init(m); + if ( !(promise instanceof Promise) ) { + promise = Promise.resolve(true); + } + + promise.then(yes).catch((err) => { console.error(err); return yes(false); });