From d46def6606bb60dc5f362d8e6d8cba0a27e37438 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 15 Jan 2015 20:11:23 +0000 Subject: [PATCH] make sure null is returned as null, not as empty object ({}) --- phpgwapi/js/jsapi/egw_preferences.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/phpgwapi/js/jsapi/egw_preferences.js b/phpgwapi/js/jsapi/egw_preferences.js index d0da815bd5..2827555580 100644 --- a/phpgwapi/js/jsapi/egw_preferences.js +++ b/phpgwapi/js/jsapi/egw_preferences.js @@ -66,9 +66,10 @@ egw.extend('preferences', egw.MODULE_GLOBAL, function() { request.sendRequest(false, 'GET'); // use synchronous (cachable) GET request if (typeof prefs[_app] == 'undefined') prefs[_app] = {}; } - if(_name == "*") return typeof prefs[_app] ==='object'?jQuery.extend({},prefs[_app]):prefs[_app]; + if (_name == "*") return typeof prefs[_app] ==='object' ? jQuery.extend({},prefs[_app]) : prefs[_app]; - return typeof prefs[_app][_name] ==='object'?jQuery.extend({},prefs[_app][_name]):prefs[_app][_name]; + return typeof prefs[_app][_name] === 'object' && prefs[_app][_name] !== null ? + jQuery.extend({},prefs[_app][_name]) : prefs[_app][_name]; }, /**