Skip to content

Commit 872456e

Browse files
authored
Prevent the NativeEditorNotificationProvider from passing flutter.androidstudio.open as a valid action id. (#7551)
Additionally, nullability annotations were added to method signatures. This is follow up on #7412 This resolves #7488
1 parent d0c3dd2 commit 872456e

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Next
2+
- Resolve "Exception: Cannot invoke "org..AnAction.getTemplatePresentation()" exception (#7488)
23
- Resolve Released EditorImpl held by lambda in FlutterReloadManager (#7507)
34
- Configure the Project view for Flutter in AS, when creating a new Flutter project (#4470)
45
- Migrate to Kotlin UI DSL Version 2 (#7310)

flutter-idea/src/io/flutter/editor/NativeEditorNotificationProvider.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,30 +49,35 @@ public EditorNotificationPanel createNotificationPanel(@NotNull VirtualFile file
4949
return createPanelForFile(file, findRootDir(file, project.getBaseDir()));
5050
}
5151

52-
private EditorNotificationPanel createPanelForFile(VirtualFile file, VirtualFile root) {
52+
@Nullable
53+
private EditorNotificationPanel createPanelForFile(@NotNull VirtualFile file, @Nullable VirtualFile root) {
5354
if (root == null) {
5455
return null;
5556
}
5657
return createPanelForAction(file, root, getActionName(root));
5758
}
5859

59-
private EditorNotificationPanel createPanelForAction(VirtualFile file, VirtualFile root, String actionName) {
60+
@Nullable
61+
private EditorNotificationPanel createPanelForAction(@NotNull VirtualFile file, @NotNull VirtualFile root, @Nullable String actionName) {
6062
if (actionName == null) {
6163
return null;
6264
}
6365
final NativeEditorActionsPanel panel = new NativeEditorActionsPanel(file, root, actionName);
6466
return panel.isValidForFile() ? panel : null;
6567
}
6668

67-
private static String getActionName(VirtualFile root) {
69+
@Nullable
70+
private static String getActionName(@Nullable VirtualFile root) {
6871
if (root == null) {
6972
return null;
7073
}
7174

72-
if (root.getName().equals("android")) {
73-
return "flutter.androidstudio.open";
74-
}
75-
else if (root.getName().equals("ios")) {
75+
// See https://github.com/flutter/flutter-intellij/issues/7103
76+
//if (root.getName().equals("android")) {
77+
// return "flutter.androidstudio.open";
78+
//}
79+
//else
80+
if (root.getName().equals("ios")) {
7681
return "flutter.xcode.open";
7782
}
7883
else if (root.getName().equals("macos")) {

resources/META-INF/plugin.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
<![CDATA[
4848
<h1>Next</h1>
4949
<ul>
50+
<li>Resolve &quot;Exception: Cannot invoke &quot;org..AnAction.getTemplatePresentation()&quot; exception (#7488)</li>
5051
<li>Resolve Released EditorImpl held by lambda in FlutterReloadManager (#7507)</li>
5152
<li>Configure the Project view for Flutter in AS, when creating a new Flutter project (#4470)</li>
5253
<li>Migrate to Kotlin UI DSL Version 2 (#7310)</li>

0 commit comments

Comments
 (0)