From 8e66bc33bf19bec4701697cd6d8cfd6d57fe9575 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 1 Apr 2013 19:06:47 +0000 Subject: [PATCH] Fix error in window module instanciation --- phpgwapi/js/jsapi/egw_core.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/phpgwapi/js/jsapi/egw_core.js b/phpgwapi/js/jsapi/egw_core.js index cfd2362bb4..16016c9e87 100644 --- a/phpgwapi/js/jsapi/egw_core.js +++ b/phpgwapi/js/jsapi/egw_core.js @@ -617,18 +617,20 @@ // Check whether the module container for that window // has been found - if (mods != null) + if (mods != null && typeof mods[_module] != 'undefined') { - // If the given module has not been instanciated for - // this window, - if (typeof mods[_module] === 'undefined') - { - var mod = modules[_module]; - mods[_module] = mod.code.call(this, null, _for); - } - return mods[_module]; } + // If the given module has not been instanciated for + // this window, instanciate it + if (mods == null) mods = {}; + if (typeof mods[_module] === 'undefined') + { + var mod = modules[_module]; + mods[_module] = mod.code.call(this, null, _for); + } + return mods[_module]; + } }