From 9fd24869fabffbf1c8c249b83aba49ab02c25b45 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 22 Dec 2010 10:42:36 -0800 Subject: [PATCH] bug 7641: resource page - Add Pod dialog, Add Host dialog - zone dropdown field might be empty (e.g. before first zone is created). Skip API call if zone field is empty. --- ui/scripts/cloud.core.resource.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/scripts/cloud.core.resource.js b/ui/scripts/cloud.core.resource.js index 03a55a5e6ea..5c93053e7e7 100644 --- a/ui/scripts/cloud.core.resource.js +++ b/ui/scripts/cloud.core.resource.js @@ -324,6 +324,8 @@ function initAddPodShortcut() { $zoneDropdown.bind("change", function(event) { var zoneId = $(this).val(); + if(zoneId == null) + return; $.ajax({ data: createURL("command=listZones&id="+zoneId), dataType: "json", @@ -484,6 +486,8 @@ function initAddHostShortcut() { $dialogAddHost.find("#zone_dropdown").bind("change", function(event) { var zoneId = $(this).val(); + if(zoneId == null) + return; $.ajax({ data: createURL("command=listPods&zoneId="+zoneId), dataType: "json",