Skip to content

Commit ac6e7e6

Browse files
authored
[fix] stop swallowing ProcessCanceledException (#8117)
`ProcessCanceledException`s need to be rethrown so that the IDEA infrastructure can handle them properly. ![image](https://github.com/user-attachments/assets/722f1b68-e540-48e1-886f-c12e5406c7a7) --- - [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR. <details> <summary>Contribution guidelines:</summary><br> - See our [contributor guide]([https://github.com/dart-lang/sdk/blob/main/CONTRIBUTING.md](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview) for general expectations for PRs. - Larger or significant changes should be discussed in an issue before creating a PR. - Dart contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`. - Java and Kotlin contributions should strive to follow Java and Kotlin best practices ([discussion](#8098)). </details>
1 parent fce3759 commit ac6e7e6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

flutter-idea/src/io/flutter/run/FlutterDebugProcess.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,16 @@ private static void suppressDebugViews(@Nullable RunnerLayoutUi ui) {
138138

139139
final String name = XDebuggerBundle.message("debugger.session.tab.console.content.name");
140140
for (Content c : ui.getContents()) {
141-
if (!Objects.equals(c.getTabName(), name)) {
141+
if (c != null && !Objects.equals(c.getTabName(), name)) {
142142
try {
143-
ApplicationManager.getApplication().invokeAndWait(() -> ui.removeContent(c, false /* dispose? */));
143+
var application = ApplicationManager.getApplication();
144+
if (application != null) {
145+
application.invokeAndWait(() -> ui.removeContent(c, false /* dispose? */));
146+
}
144147
}
145148
catch (ProcessCanceledException e) {
146149
FlutterUtils.warn(LOG, e);
150+
throw e;
147151
}
148152
}
149153
}

0 commit comments

Comments
 (0)