From 0c68019dc11a24da24a27f81fa5e5b6c6f5c788b Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Thu, 10 Dec 2009 13:51:47 +0000 Subject: [PATCH] Bug 296549: NPE accessing implicit methods. --- .../parser/cpp/AbstractCPPClassSpecializationScope.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/AbstractCPPClassSpecializationScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/AbstractCPPClassSpecializationScope.java index 9410007f34d..992a8805957 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/AbstractCPPClassSpecializationScope.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/AbstractCPPClassSpecializationScope.java @@ -163,8 +163,11 @@ public class AbstractCPPClassSpecializationScope implements ICPPClassSpecializat public ICPPMethod[] getImplicitMethods() { try { - ICPPClassScope origClassType= (ICPPClassScope) specialClass.getSpecializedBinding().getCompositeScope(); - ICPPMethod[] methods= origClassType.getImplicitMethods(); + ICPPClassScope origClassScope= (ICPPClassScope) specialClass.getSpecializedBinding().getCompositeScope(); + if (origClassScope == null) { + return ICPPMethod.EMPTY_CPPMETHOD_ARRAY; + } + ICPPMethod[] methods= origClassScope.getImplicitMethods(); return specializeMembers(methods); } catch (DOMException e) { return ICPPMethod.EMPTY_CPPMETHOD_ARRAY;