Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2005-07-08 13:23:20 -0400
committerAndrew Niefer2005-07-08 13:23:20 -0400
commit4c6445634e6e620f6bd12010e742d62c089b85c7 (patch)
tree98c42902fee3f1aca0a5f8d0f1eccf2fbcbe3cff
parent609f1f0233b996fe185c5541fe3e1bdb427dda5d (diff)
downloadorg.eclipse.cdt-4c6445634e6e620f6bd12010e742d62c089b85c7.tar.gz
org.eclipse.cdt-4c6445634e6e620f6bd12010e742d62c089b85c7.tar.xz
org.eclipse.cdt-4c6445634e6e620f6bd12010e742d62c089b85c7.zip
guard against NPEs, bug 102232
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateDefinition.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateDefinition.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateDefinition.java
index d20b3dcf80..df4c6f5441 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateDefinition.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateDefinition.java
@@ -200,10 +200,12 @@ public abstract class CPPTemplateDefinition implements ICPPTemplateDefinition, I
for( ; j < length; j++ ){
template = ( j == -1 ) ? CPPTemplates.getTemplateDeclaration( definition )
: CPPTemplates.getTemplateDeclaration( declarations[j] );
+ if( template == null )
+ continue;
temp = template.getTemplateParameters()[i];
IASTName n = CPPTemplates.getTemplateParameterName( temp );
- if( n != name && n.getBinding() == null ) {
+ if( n != null && n != name && n.getBinding() == null ) {
n.setBinding( binding );
if( binding instanceof ICPPInternalBinding )
((ICPPInternalBinding)binding).addDeclaration( n );

Back to the top