mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-37280 avoid surprise NPE: check if specific GotoDeclarationHandler returned null element in array
This commit is contained in:
+6
@@ -212,6 +212,12 @@ public class GotoDeclarationAction extends BaseCodeInsightAction implements Code
|
||||
try {
|
||||
PsiElement[] result = handler.getGotoDeclarationTargets(elementAt, offset, editor);
|
||||
if (result != null && result.length > 0) {
|
||||
for (PsiElement element : result) {
|
||||
if (element == null) {
|
||||
LOG.error("Null target element is returned by " + handler.getClass().getCanonicalName());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user