Skip to content

Commit 8443ad2

Browse files
authored
Fix toolwindow not running in edt (#3143)
1 parent 991b944 commit 8443ad2

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Fix toolWindow not running in EDT"
4+
}

jetbrains-core/src/software/aws/toolkits/jetbrains/core/toolwindow/ToolkitToolWindow.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ interface ToolkitToolWindow {
7272
if (content != null) {
7373
toolWindow.activate(null, true)
7474
toolWindow.contentManager.setSelectedContent(content)
75-
7675
return true
7776
}
7877

jetbrains-core/src/software/aws/toolkits/jetbrains/services/cloudwatch/logs/CloudWatchLogWindow.kt

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,20 @@ class CloudWatchLogWindow(override val project: Project) : ToolkitToolWindow {
2727

2828
fun showLogGroup(logGroup: String) {
2929
var result = Result.Succeeded
30-
try {
31-
if (showExistingContent(logGroup)) {
32-
return
33-
}
34-
val group = CloudWatchLogGroup(project, logGroup)
35-
val title = message("cloudwatch.logs.log_group_title", logGroup.split("/").last())
36-
runInEdt {
37-
addTab(title, group.content, activate = true, id = logGroup, additionalDisposable = group)
30+
runInEdt {
31+
try {
32+
if (!showExistingContent(logGroup)) {
33+
val group = CloudWatchLogGroup(project, logGroup)
34+
val title = message("cloudwatch.logs.log_group_title", logGroup.split("/").last())
35+
addTab(title, group.content, activate = true, id = logGroup, additionalDisposable = group)
36+
}
37+
} catch (e: Exception) {
38+
LOG.error(e) { "Exception thrown while trying to show log group '$logGroup'" }
39+
result = Result.Failed
40+
throw e
41+
} finally {
42+
CloudwatchlogsTelemetry.openGroup(project, result)
3843
}
39-
} catch (e: Exception) {
40-
LOG.error(e) { "Exception thrown while trying to show log group '$logGroup'" }
41-
result = Result.Failed
42-
throw e
43-
} finally {
44-
CloudwatchlogsTelemetry.openGroup(project, result)
4544
}
4645
}
4746

0 commit comments

Comments
 (0)