1
0
Fork 0
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:
Anton Leherbauer 2007-04-19 15:39:10 +00:00
parent eda6e679cf
commit ef4ddbd189

View file

@ -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;