Skip to content

Commit 8f470d0

Browse files
committed
fix: Cannot read field "parent" because "comp" is null
Fixes #1195 Signed-off-by: azerr <azerr@redhat.com>
1 parent b1200df commit 8f470d0

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

src/main/java/com/redhat/devtools/lsp4ij/ui/LanguageServerSuggestionEditorNotificationProvider.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
package com.redhat.devtools.lsp4ij.ui;
1212

1313
import com.intellij.ide.util.PropertiesComponent;
14+
import com.intellij.openapi.application.ApplicationManager;
1415
import com.intellij.openapi.fileEditor.FileEditor;
1516
import com.intellij.openapi.project.Project;
1617
import com.intellij.openapi.vfs.VirtualFile;
@@ -138,19 +139,23 @@ private EditorNotificationPanel buildPanel(@NotNull String filePattern,
138139
NewLanguageServerDialog dialog = new NewLanguageServerDialog(project);
139140
dialog.loadFromTemplate(template);
140141
dialog.show();
141-
// Refresh notifications to hide it
142-
EditorNotifications.getInstance(project)
143-
.updateAllNotifications();
142+
// Refresh notifications to hide it (deferred to avoid race condition)
143+
ApplicationManager.getApplication().invokeLater(() -> {
144+
EditorNotifications.getInstance(project)
145+
.updateAllNotifications();
146+
});
144147
});
145148
});
146149

147150
// Dismiss button (can be enhanced to persist dismissal if needed)
148151
panel.createActionLabel(LanguageServerBundle.message("language.server.suggest.install.dismiss"), () -> {
149152
// Store preference to disable future notifications
150153
PropertiesComponent.getInstance().setValue(DISABLE_KEY, true);
151-
// Refresh notifications to hide the panel
152-
EditorNotifications.getInstance(project)
153-
.updateAllNotifications();
154+
// Refresh notifications to hide the panel (deferred to avoid race condition)
155+
ApplicationManager.getApplication().invokeLater(() -> {
156+
EditorNotifications.getInstance(project)
157+
.updateAllNotifications();
158+
});
154159
});
155160

156161
return panel;

0 commit comments

Comments
 (0)