mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 01:36:01 +02:00
Guard against NPE
This commit is contained in:
parent
eda6e679cf
commit
ef4ddbd189
1 changed files with 1 additions and 1 deletions
|
@ -109,7 +109,7 @@ public class OpenTypeAction implements IWorkbenchWindowActionDelegate {
|
||||||
private boolean openTypeInEditor(ITypeReference location) {
|
private boolean openTypeInEditor(ITypeReference location) {
|
||||||
ICElement[] cElements= location.getCElements();
|
ICElement[] cElements= location.getCElements();
|
||||||
try {
|
try {
|
||||||
if (cElements.length > 0) {
|
if (cElements != null && cElements.length > 0) {
|
||||||
IEditorPart editor= EditorUtility.openInEditor(cElements[0]);
|
IEditorPart editor= EditorUtility.openInEditor(cElements[0]);
|
||||||
EditorUtility.revealInEditor(editor, cElements[0]);
|
EditorUtility.revealInEditor(editor, cElements[0]);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue