mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 17:26: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) {
|
||||
ICElement[] cElements= location.getCElements();
|
||||
try {
|
||||
if (cElements.length > 0) {
|
||||
if (cElements != null && cElements.length > 0) {
|
||||
IEditorPart editor= EditorUtility.openInEditor(cElements[0]);
|
||||
EditorUtility.revealInEditor(editor, cElements[0]);
|
||||
return true;
|
||||
|
|
Loading…
Add table
Reference in a new issue