Skip to content

Commit

Permalink
[#320] prevent possible NPE in isFileOpenedInLspEditor (#321)
Browse files Browse the repository at this point in the history
getEditor can return null.

may be a fix for #320
  • Loading branch information
ghentschke committed May 22, 2024
1 parent 6d6209b commit 8cefa66
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static boolean isFileOpenedInLspEditor(IEditorInput editorInput) {
continue;
}
if (editorInput.equals(editorInputFromEditor)) {
return LspPlugin.LSP_C_EDITOR_ID.equals(editor.getEditor(true).getEditorSite().getId());
return LspPlugin.LSP_C_EDITOR_ID.equals(editor.getId());
}
}
// the file has not been opened yet:
Expand Down

0 comments on commit 8cefa66

Please sign in to comment.