Skip to content

Commit 22da244

Browse files
resolve comments.
1 parent e020b62 commit 22da244

File tree

3 files changed

+8
-3
lines changed
  • PluginsAndFeatures/azure-toolkit-for-intellij

3 files changed

+8
-3
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-springcloud/src/main/java/com/microsoft/azure/toolkit/intellij/springcloud/properties/SpringCloudAppPropertiesEditor.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@ protected void rerender() {
6666
tm.runLater(() -> {
6767
this.setEnabled(false);
6868
tm.runOnPooledThread(() -> {
69-
this.deploymentDraft = this.draft.updateOrCreateActiveDeployment();
69+
final SpringCloudDeployment deployment = this.draft.getActiveDeployment();
70+
if (deployment == null) {
71+
AzureMessager.getMessager().warning(AzureString.format("No active deployment found for app(%s)", this.draft.getName()));
72+
return;
73+
}
74+
this.deploymentDraft = (SpringCloudDeploymentDraft) (deployment.isDraft() ? deployment : deployment.update());
7075
tm.runLater(() -> {
7176
this.formConfig.updateForm(this.draft);
7277
this.panelInstances.setApp(this.draft);

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-resource-connector-lib/src/main/java/com/microsoft/azure/toolkit/intellij/connector/dotazure/AzureModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public AzureModule(@Nonnull final Module module, @Nullable VirtualFile dotAzure)
7878

7979
@SneakyThrows(value = {IOException.class, JDOMException.class})
8080
private void loadProfiles(@Nonnull final VirtualFile profilesXmlFile) {
81-
if (profilesXmlFile.contentsToByteArray().length < 1 && !profilesXmlFile.exists()) {
81+
if (!profilesXmlFile.exists() || profilesXmlFile.contentsToByteArray().length < 1) {
8282
return;
8383
}
8484
final Element profilesEle = JDOMUtil.load(Objects.requireNonNull(profilesXmlFile).toNioPath());

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-resource-connector-lib/src/main/java/com/microsoft/azure/toolkit/intellij/connector/projectexplorer/ResourceNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public void onClicked(Object event) {
9393
@Nullable
9494
public IActionGroup getActionGroup() {
9595
final IActionGroup originalGroup = Optional.ofNullable(getValue()).map(Node::getActions).orElse(null);
96-
final Object value = this.getValue().getValue();
96+
final Object value = Optional.ofNullable(getValue()).map(Node::getValue).orElse(null);
9797
if (this.parent instanceof DeploymentTargetsNode targets && value instanceof AbstractAzResource<?, ?, ?> resource) {
9898
final AzureTaskManager tm = AzureTaskManager.getInstance();
9999
final Action<Object> removeTarget = new Action<>(Action.Id.of("user/connector.remove_target.app"))

0 commit comments

Comments
 (0)