Skip to content

Commit 25691ea

Browse files
authored
[fix] unsafe debugToolWindow access (#8395)
It's not safe to assume that the debug window is visible when running/debugging (from the toolbar), so we need to add a check. (Note that something similar is already done for the run window.) Fixes: #8391 --- <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 ef3ad8f commit 25691ea

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/io/flutter/toolwindow/ToolWindowBadgeUpdater.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ public static void updateBadgedIcon(FlutterApp app, Project project) {
4242
}
4343
else if (app.getMode() == RunMode.DEBUG) {
4444
manager.invokeLater(() -> {
45-
Icon baseIcon = AllIcons.Toolwindows.ToolWindowDebugger;
46-
BadgeIcon iconWithBadge = new BadgeIcon(baseIcon, BADGE_PAINT);
47-
Objects.requireNonNull(debugToolWindow).setIcon(iconWithBadge);
45+
// https://github.com/flutter/flutter-intellij/issues/8391
46+
if (debugToolWindow != null) {
47+
Icon baseIcon = AllIcons.Toolwindows.ToolWindowDebugger;
48+
BadgeIcon iconWithBadge = new BadgeIcon(baseIcon, BADGE_PAINT);
49+
runToolWindow.setIcon(iconWithBadge);
50+
}
4851
});
4952
}
5053
}

0 commit comments

Comments
 (0)