From 34536f7e8945d333a98b75d2fcb190150d7af8c3 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 9 Jul 2015 18:01:22 +0000 Subject: [PATCH] Fix copy-paste error in favorite selection comparison, giving TypeError. --- phpgwapi/js/jsapi/app_base.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/phpgwapi/js/jsapi/app_base.js b/phpgwapi/js/jsapi/app_base.js index 955f05e768..1af541941e 100644 --- a/phpgwapi/js/jsapi/app_base.js +++ b/phpgwapi/js/jsapi/app_base.js @@ -802,10 +802,11 @@ var AppJS = Class.extend( { match_count++; } - else if (typeof state[state_key][sub_key] === 'object' && typeof state[state_key][sub_key] === 'object') + else if (state[state_key][sub_key] && favorite.state[state_key][sub_key] && + typeof state[state_key][sub_key] === 'object' && typeof favorite.state[state_key][sub_key] === 'object') { // Too deep to keep going, just string compare for perfect match - if(state[state_key][sub_key].toJSON() === state[state_key][sub_key]) + if(state[state_key][sub_key].toJSON() === favorite.state[state_key][sub_key]) { match_count++; }