mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
NPE in goto handler
This commit is contained in:
+2
@@ -22,6 +22,7 @@ import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
@@ -30,6 +31,7 @@ public class GotoImplementationHandler extends GotoTargetHandler {
|
||||
return "navigation.goto.implementation";
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public GotoData getSourceAndTargetElements(Editor editor, PsiFile file) {
|
||||
int offset = editor.getCaretModel().getOffset();
|
||||
PsiElement source = TargetElementUtilBase.getInstance().findTargetElement(editor, ImplementationSearcher.getFlags(), offset);
|
||||
|
||||
@@ -56,7 +56,7 @@ public abstract class GotoTargetHandler implements CodeInsightActionHandler {
|
||||
|
||||
try {
|
||||
GotoData gotoData = getSourceAndTargetElements(editor, file);
|
||||
if (gotoData.source != null) {
|
||||
if (gotoData != null) {
|
||||
show(project, editor, file, gotoData.source, gotoData.targets, gotoData.additionalActions);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user