1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

2004-07-06 Chris Wiebe

This patch prevents some NPEs from happening in the class browser.  I
	suggest this should be applied to both HEAD and CDT_2_0 branch.

	* browser/org/eclipse/cdt/core/browser/TypeInfo.java
This commit is contained in:
Alain Magloire 2004-07-06 17:50:51 +00:00
parent 7d99be71a5
commit 2b5f813e6b
2 changed files with 11 additions and 3 deletions

View file

@ -1,3 +1,10 @@
2004-07-06 Chris Wiebe
This patch prevents some NPEs from happening in the class browser. I
suggest this should be applied to both HEAD and CDT_2_0 branch.
* browser/org/eclipse/cdt/core/browser/TypeInfo.java
2004-06-22 Alain Magloire
Part of PR 68246.
Close the inputstream to release resource handle

View file

@ -58,7 +58,10 @@ public class TypeInfo implements ITypeInfo
ITypeReference ref = getResolvedReference();
if (ref != null) {
ICElement[] elems = ref.getCElements();
if (elems.length > 1) {
if (elems != null && elems.length > 0) {
if (elems.length == 1)
return elems[0];
for (int i = 0; i < elems.length; ++i) {
ICElement elem = elems[i];
if (elem.getElementType() == fElementType && elem.getElementName().equals(getName())) {
@ -66,8 +69,6 @@ public class TypeInfo implements ITypeInfo
return elem;
}
}
} else if (elems.length == 1) {
return elems[0];
}
}
return null;