Make sure state object exists

-Fix error "Cannot read property 'sort' of undefined" for favorites without state
This commit is contained in:
Hadi Nategh 2014-10-02 09:07:46 +00:00
parent 1c783df3b8
commit 3cee4332ee

View File

@ -285,7 +285,7 @@ var AppJS = Class.extend(
if(state.state && state.state.search) state.state.search = unescape(state.state.search); if(state.state && state.state.search) state.state.search = unescape(state.state.search);
// Apply // 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); _widget.sortBy(state.state.sort.id, state.state.sort.asc,false);
} }