From b8d006c8f514c63448d490790ad25f83e2c57a4c 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 8967d6a8608..37bb80634d2 100644 --- a/ui/scripts/autoscaler.js +++ b/ui/scripts/autoscaler.js @@ -142,15 +142,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,