Skip to content

Commit 2454937

Browse files
authored
Merge pull request #5079 from microsoft/andy-hotfix2
Fix issue: Access is allowed from event dispatch thread with IW lock only
2 parents 6c4dd68 + 0bf17a2 commit 2454937

File tree

1 file changed

+9
-2
lines changed
  • PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/azure/toolkit/intellij/webapp/runner/webappconfig/slimui

1 file changed

+9
-2
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/azure/toolkit/intellij/webapp/runner/webappconfig/slimui/WebAppSlimSettingPanel.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
import com.intellij.icons.AllIcons;
99
import com.intellij.ide.IdeTooltipManager;
10+
import com.intellij.openapi.application.ApplicationManager;
1011
import com.intellij.openapi.project.Project;
1112
import com.intellij.openapi.util.Comparing;
1213
import com.intellij.packaging.artifacts.Artifact;
1314
import com.intellij.ui.HideableDecorator;
1415
import com.intellij.ui.HyperlinkLabel;
1516
import com.microsoft.azure.management.appservice.DeploymentSlot;
16-
import com.microsoft.azure.toolkit.intellij.appservice.AppServiceComboBoxModel;
1717
import com.microsoft.azure.toolkit.intellij.common.*;
1818
import com.microsoft.azure.toolkit.intellij.webapp.WebAppComboBox;
1919
import com.microsoft.azure.toolkit.intellij.webapp.WebAppComboBoxModel;
@@ -250,7 +250,14 @@ protected void apply(@NotNull WebAppConfiguration configuration) {
250250
}
251251
configuration.setDeployToRoot(chkToRoot.isVisible() && chkToRoot.isSelected());
252252
configuration.setOpenBrowserAfterDeployment(chkOpenBrowser.isSelected());
253-
syncBeforeRunTasks(comboBoxArtifact.getValue(), configuration);
253+
// hot fix, to avoid similar cases, prefer to refactor this code with common factory
254+
if (ApplicationManager.getApplication().isDispatchThread()) {
255+
syncBeforeRunTasks(comboBoxArtifact.getValue(), configuration);
256+
} else {
257+
ApplicationManager.getApplication().invokeLater(() ->
258+
syncBeforeRunTasks(comboBoxArtifact.getValue(), configuration)
259+
);
260+
}
254261
}
255262

256263
private boolean isAbleToDeployToRoot(final AzureArtifact azureArtifact) {

0 commit comments

Comments
 (0)