From 50a30712fb477ee5d99a0374b3eee2702bddbcd2 Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Fri, 15 Jun 2007 11:14:51 +0000 Subject: [PATCH] Fixes a NPE in the TypeSelectionDialog. --- .../cdt/ui/browser/typeinfo/TypeSelectionDialog.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeSelectionDialog.java b/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeSelectionDialog.java index d7ccf3308a5..038feeb7e5e 100644 --- a/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeSelectionDialog.java +++ b/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeSelectionDialog.java @@ -636,11 +636,13 @@ public class TypeSelectionDialog extends TwoPaneElementSelector { public Object[] getFoldedElements(int index) { ArrayList result= new ArrayList(); Object[] typeInfos= super.getFoldedElements(index); - for (int i = 0; i < typeInfos.length; i++) { - Object typeInfo = typeInfos[i]; - if (typeInfo instanceof IndexTypeInfo) { - addFoldedElements((IndexTypeInfo) typeInfo, result); - } + if (typeInfos != null) { + for (int i = 0; i < typeInfos.length; i++) { + Object typeInfo = typeInfos[i]; + if (typeInfo instanceof IndexTypeInfo) { + addFoldedElements((IndexTypeInfo) typeInfo, result); + } + } } return result.toArray(); }