CLOUDSTACK-550:Getting TypeError: items is undefined error in UI when we click on Instances tab while no instances are launched yet:Handling the null case for items

This commit is contained in:
Pranav Saxena 2012-11-27 17:29:50 +05:30
parent 2149b82b36
commit ed5bd846e8

View File

@ -203,6 +203,7 @@
data: data,
success: function(json) {
var items = json.listvirtualmachinesresponse.virtualmachine;
if(items != null) {
var i=0;
for( i=0;i< items.length;i++){
if(items[i].state == 'Expunging')
@ -217,6 +218,15 @@
}
}
}
else {
args.response.success({
actionFilter: vmActionfilter,
data: items
});
}
}
});
},