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:06:15 +00:00
parent 7f3c3e5613
commit 3404c704a6

View File

@ -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);
}