Skip to content

Commit 0da2736

Browse files
committed
ui: fix instances null check regression from 2f250e2
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent e65446c commit 0da2736

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

ui/scripts/instances.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,13 @@
358358
data: data,
359359
success: function(json) {
360360
var items = json.listvirtualmachinesresponse.virtualmachine;
361-
$.each(items, function(idx, vm) {
362-
if (vm.nic && vm.nic.length > 0 && vm.nic[0].ipaddress) {
363-
items[idx].ipaddress = vm.nic[0].ipaddress;
364-
}
365-
});
361+
if (items) {
362+
$.each(items, function(idx, vm) {
363+
if (vm.nic && vm.nic.length > 0 && vm.nic[0].ipaddress) {
364+
items[idx].ipaddress = vm.nic[0].ipaddress;
365+
}
366+
});
367+
}
366368
args.response.success({
367369
data: items
368370
});

0 commit comments

Comments
 (0)