ui: Fix undefined check in instances.js, regression from 459d638

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2015-11-25 14:17:32 +05:30
parent 5b8fc22be2
commit 0bbd9a06a9
1 changed files with 7 additions and 5 deletions

View File

@ -397,11 +397,13 @@
data: data,
success: function(json) {
var items = json.listvirtualmachinesresponse.virtualmachine;
$.each(items, function(idx, vm) {
if (vm.nic && vm.nic.length > 0 && vm.nic[0].ipaddress) {
items[idx].ipaddress = vm.nic[0].ipaddress;
}
});
if (items) {
$.each(items, function(idx, vm) {
if (vm.nic && vm.nic.length > 0 && vm.nic[0].ipaddress) {
items[idx].ipaddress = vm.nic[0].ipaddress;
}
});
}
args.response.success({
data: items
});