From c3abca67dbd9fc1dfae2bde2dcfe99c105b0dfe9 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 9 Nov 2011 16:32:42 +0000 Subject: [PATCH] Return an array, not null, if there are no preferences for the app --- phpgwapi/inc/class.egw_framework.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.egw_framework.inc.php b/phpgwapi/inc/class.egw_framework.inc.php index 0708693c4a..4d56db6594 100644 --- a/phpgwapi/inc/class.egw_framework.inc.php +++ b/phpgwapi/inc/class.egw_framework.inc.php @@ -1269,7 +1269,9 @@ abstract class egw_framework if (preg_match('/^[a-z0-9_]+$/i', $app)) { $response = egw_json_response::get(); - $response->script('window.egw.set_preferences('.json_encode($GLOBALS['egw_info']['user']['preferences'][$app]).', "'.$app.'");'); + $pref = $GLOBALS['egw_info']['user']['preferences'][$app]; + if(!$pref) $pref = Array(); + $response->script('window.egw.set_preferences('.json_encode($pref).', "'.$app.'");'); } } }