From 15d1e57b92e20ac97632d6b6fd7076fc57688019 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 7 Aug 2012 14:09:40 -0700 Subject: [PATCH] cloudstack 3.0 UI - autoscale - existing LB - configure AutoScale - fix a JS bug "otherdeployparams is undefined". --- ui/scripts/autoscaler.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/ui/scripts/autoscaler.js b/ui/scripts/autoscaler.js index 622f7d43fbd..a53d24656f0 100644 --- a/ui/scripts/autoscaler.js +++ b/ui/scripts/autoscaler.js @@ -137,15 +137,17 @@ var diskOfferingId, securityGroups; var otherdeployparams = autoscaleVmProfile.otherdeployparams; - var array1 = otherdeployparams.split('&'); - $(array1).each(function(){ - var array2 = this.split('='); - if(array2[0] == 'diskofferingid') - diskOfferingId= array2[1]; - if(array2[0] == 'securitygroupids') - securityGroups = array2[1]; - }); - + if(otherdeployparams != null && otherdeployparams.length > 0) { + var array1 = otherdeployparams.split('&'); + $(array1).each(function(){ + var array2 = this.split('='); + if(array2[0] == 'diskofferingid') + diskOfferingId= array2[1]; + if(array2[0] == 'securitygroupids') + securityGroups = array2[1]; + }); + } + var originalAutoscaleData = { templateNames: autoscaleVmProfile.templateid, serviceOfferingId: autoscaleVmProfile.serviceofferingid,