From 3cee4332ee3e3e71cdcbb603f3363810c1652d6b Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 2 Oct 2014 09:07:46 +0000 Subject: [PATCH] Make sure state object exists -Fix error "Cannot read property 'sort' of undefined" for favorites without state --- phpgwapi/js/jsapi/app_base.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpgwapi/js/jsapi/app_base.js b/phpgwapi/js/jsapi/app_base.js index bec9849087..007a2e8610 100644 --- a/phpgwapi/js/jsapi/app_base.js +++ b/phpgwapi/js/jsapi/app_base.js @@ -285,7 +285,7 @@ var AppJS = Class.extend( if(state.state && state.state.search) state.state.search = unescape(state.state.search); // Apply - if(state.state.sort && state.state.sort.id) + if(state.state && state.state.sort && state.state.sort.id) { _widget.sortBy(state.state.sort.id, state.state.sort.asc,false); }