mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-55708 - NPE: FileEditorManager.getInstance
This commit is contained in:
@@ -30,7 +30,7 @@ import java.io.File;
|
||||
import java.util.Collection;
|
||||
|
||||
public interface VcsContext extends PlaceProvider<String> {
|
||||
Project getProject();
|
||||
@Nullable Project getProject();
|
||||
|
||||
@Nullable
|
||||
VirtualFile getSelectedFile();
|
||||
|
||||
@@ -111,8 +111,11 @@ public class AnnotateToggleAction extends ToggleAction implements DumbAware, Ann
|
||||
if (selectedFile == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Project project = context.getProject();
|
||||
if (project == null) return false;
|
||||
|
||||
for (FileEditor fileEditor : FileEditorManager.getInstance(context.getProject()).getEditors(selectedFile)) {
|
||||
for (FileEditor fileEditor : FileEditorManager.getInstance(project).getEditors(selectedFile)) {
|
||||
if (fileEditor instanceof TextEditor) {
|
||||
if (isAnnotated(((TextEditor)fileEditor).getEditor())) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user