Skip to content

Commit 45b32bf

Browse files
committed
Fix select function when open function deployment panel, AB#1994301
1 parent 81f95a7 commit 45b32bf

File tree

1 file changed

+12
-10
lines changed
  • PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-appservice/src/main/java/com/microsoft/azure/toolkit/intellij/legacy/function/runner/deploy/ui

1 file changed

+12
-10
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-appservice/src/main/java/com/microsoft/azure/toolkit/intellij/legacy/function/runner/deploy/ui/FunctionDeploymentPanel.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,18 @@ protected void resetFromConfig(@NotNull FunctionDeployConfiguration configuratio
142142
if (StringUtils.isNotEmpty(configuration.getAppSettingsKey())) {
143143
this.appSettingsKey = configuration.getAppSettingsKey();
144144
}
145-
Optional.ofNullable(configuration.getConfig()).ifPresent(config -> {
146-
this.functionAppComboBox.setValue(config);
147-
this.functionAppComboBox.setConfigModel(config);
148-
this.chkSlot.setSelected(config.getDeploymentSlot() != null);
149-
this.toggleDeploymentSlot(config.getDeploymentSlot() != null);
150-
this.appSettingsResourceId = StringUtils.isAllEmpty(config.getResourceId(), config.getName()) ? null :
151-
getResourceId(config, config.getDeploymentSlot());
152-
Optional.ofNullable(config.getDeploymentSlot()).ifPresent(cbDeploymentSlot::setValue);
153-
Optional.ofNullable(config.getAppSettings()).ifPresent(appSettingsTable::setAppSettings);
154-
});
145+
Optional.ofNullable(configuration.getConfig())
146+
.filter(config -> !StringUtils.isAllEmpty(config.getResourceId(), config.getName()))
147+
.ifPresent(config -> {
148+
this.functionAppComboBox.setValue(config);
149+
this.functionAppComboBox.setConfigModel(config);
150+
this.chkSlot.setSelected(config.getDeploymentSlot() != null);
151+
this.toggleDeploymentSlot(config.getDeploymentSlot() != null);
152+
this.appSettingsResourceId = StringUtils.isAllEmpty(config.getResourceId(), config.getName()) ? null :
153+
getResourceId(config, config.getDeploymentSlot());
154+
Optional.ofNullable(config.getDeploymentSlot()).ifPresent(cbDeploymentSlot::setValue);
155+
Optional.ofNullable(config.getAppSettings()).ifPresent(appSettingsTable::setAppSettings);
156+
});
155157
this.previousModule = configuration.getModule();
156158
selectModule(previousModule);
157159
}

0 commit comments

Comments
 (0)