make sure result has items

This commit is contained in:
j 2018-11-13 16:40:12 +00:00
parent f67026fc77
commit 1769bf84ff

View file

@ -167,7 +167,11 @@ pandora.ui.folderList = function(id, section) {
pandora.$ui.mainMenu.updateLists(id, result.data.items); pandora.$ui.mainMenu.updateLists(id, result.data.items);
} }
callback(result); callback(result);
if (result.data.items.length && _updateItemsCount) { if (
_updateItemsCount
&& Ox.isArray(result.data.items)
&& result.data.items.length
) {
setTimeout(function() { setTimeout(function() {
updateItemsCount(result.data.items.map(function(item) { updateItemsCount(result.data.items.map(function(item) {
return item.id; return item.id;