@@ -638,9 +638,10 @@ private void doFillSubscriptions() {
638638 comboSubscription .removeAll ();;
639639 binderSubscriptionDetails = new ArrayList <SubscriptionDetail >();
640640 for (SubscriptionDetail sd : sdl ) {
641- if (!sd .isSelected ()) continue ;
642- comboSubscription .add (sd .getSubscriptionName ());
643- binderSubscriptionDetails .add (sd );
641+ if (sd != null && sd .isSelected ()) {
642+ comboSubscription .add (sd .getSubscriptionName ());
643+ binderSubscriptionDetails .add (sd );
644+ }
644645 }
645646 if (comboSubscription .getItemCount () > 0 ) {
646647 comboSubscription .select (0 );
@@ -693,12 +694,13 @@ protected void fillAppServicePlans() {
693694 binderAppServicePlan = new ArrayList <AppServicePlan >();
694695 for (ResourceGroup rg : rgl ) {
695696 List <AppServicePlan > aspl = AzureModel .getInstance ().getResourceGroupToAppServicePlanMap ().get (rg );
696- for (AppServicePlan asp : aspl ) {
697- if (asp .pricingTier ().toSkuDescription ().tier ().compareToIgnoreCase ("dynamic" ) == 0 ) {
698- continue ;
697+ if (aspl != null ) {
698+ for (AppServicePlan asp : aspl ) {
699+ if (asp != null && asp .pricingTier ().toSkuDescription ().tier ().compareToIgnoreCase ("dynamic" ) != 0 ) {
700+ binderAppServicePlan .add (asp );
701+ comboAppServicePlan .add (asp .name ());
702+ }
699703 }
700- binderAppServicePlan .add (asp );
701- comboAppServicePlan .add (asp .name ());
702704 }
703705 }
704706
@@ -732,10 +734,11 @@ protected void fillAppServicePlanLocations() {
732734 Map <SubscriptionDetail , List <Location >> sdlocMap = AzureModel .getInstance ().getSubscriptionToLocationMap ();
733735 SubscriptionDetail sd = binderSubscriptionDetails .get (i );
734736 List <Location > locl = sdlocMap .get (sd );
735-
736- for (Location loc : locl ) {
737- comboAppServicePlanLocation .add (loc .displayName ());
738- binderAppServicePlanLocation .add (loc );
737+ if (locl != null ) {
738+ for (Location loc : locl ) {
739+ comboAppServicePlanLocation .add (loc .displayName ());
740+ binderAppServicePlanLocation .add (loc );
741+ }
739742 }
740743
741744 if (comboAppServicePlanLocation .getItemCount () > 0 ) {
@@ -749,8 +752,10 @@ protected void fillAppServicePlanPricingTiers() {
749752 binderAppServicePlanPricingTier = new ArrayList <PricingTier >();
750753 List <PricingTier > l = createListFromClassFields (PricingTier .class );
751754 for (PricingTier aspt : l ) {
752- comboAppServicePlanPricingTier .add (aspt .toString ());
753- binderAppServicePlanPricingTier .add (aspt );
755+ if (aspt != null ) {
756+ comboAppServicePlanPricingTier .add (aspt .toString ());
757+ binderAppServicePlanPricingTier .add (aspt );
758+ }
754759 }
755760 if (comboAppServicePlanPricingTier .getItemCount () > 0 ) {
756761 comboAppServicePlanPricingTier .select (0 );
@@ -764,7 +769,9 @@ protected void fillAppServicePlanPricingTiers() {
764769 protected void fillJavaVersion () {
765770 javaVersions = AzureWebAppMvpModel .getInstance ().listJdks ();
766771 for (JdkModel jdk : javaVersions ) {
767- cbJavaVersion .add (jdk .toString ());
772+ if (jdk != null ) {
773+ cbJavaVersion .add (jdk .toString ());
774+ }
768775 }
769776 if (cbJavaVersion .getItemCount () > 0 ) {
770777 cbJavaVersion .select (0 );
@@ -869,10 +876,10 @@ protected boolean validated() {
869876 if (webappName .length () > 60 || !webappName .matches (WEB_APP_NAME_REGEX )) {
870877 setError (dec_textAppName , WEB_APP_NAME_INVALID_MSG );
871878 return false ;
872- } else {
879+ } else if ( AzureModel . getInstance (). getResourceGroupToWebAppMap () != null ) {
873880 for (List <WebApp > wal : AzureModel .getInstance ().getResourceGroupToWebAppMap ().values ()) {
874881 for (WebApp wa : wal ) {
875- if (wa .name ().toLowerCase ().equals (webappName .toLowerCase ())) {
882+ if (wa != null && wa .name ().toLowerCase ().equals (webappName .toLowerCase ())) {
876883 setError (dec_textAppName ,NAME_ALREADY_TAKEN );
877884 return false ;
878885 }
@@ -896,10 +903,10 @@ protected boolean validated() {
896903 }
897904 // App service plan name must be unique in each subscription
898905 List <ResourceGroup > rgl = AzureMvpModel .getInstance ().getResourceGroupsBySubscriptionId (model .getSubscriptionId ());
899- for (ResourceGroup rg : rgl ) {
906+ for (ResourceGroup rg : rgl ) {
900907 List <AppServicePlan > aspl = AzureWebAppMvpModel .getInstance ().listAppServicePlanBySubscriptionIdAndResourceGroupName (model .getSubscriptionId (), rg .name ());
901908 for (AppServicePlan asp : aspl ) {
902- if (asp .name ().toLowerCase ().equals (model .getAppServicePlanName ().toLowerCase ())) {
909+ if (asp != null && asp .name ().toLowerCase ().equals (model .getAppServicePlanName ().toLowerCase ())) {
903910 setError (dec_textAppSevicePlanName , APP_SERVICE_PLAN_NAME_MUST_UNUQUE );
904911 return false ;
905912 }
@@ -927,7 +934,7 @@ protected boolean validated() {
927934 return false ;
928935 }
929936 for (ResourceGroup rg : AzureMvpModel .getInstance ().getResourceGroupsBySubscriptionId (model .getSubscriptionId ())) {
930- if (rg .name ().toLowerCase ().equals (model .getResourceGroup ().toLowerCase ())) {
937+ if (rg != null && rg .name ().toLowerCase ().equals (model .getResourceGroup ().toLowerCase ())) {
931938 setError (dec_textNewResGrName , NAME_ALREADY_TAKEN );
932939 return false ;
933940 }
0 commit comments