mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 18:26:01 +02:00
Fix 2 NPEs
This commit is contained in:
parent
1c83f17a74
commit
9fb1c69789
2 changed files with 6 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2007 QNX Software Systems and others.
|
||||
* Copyright (c) 2000, 2008 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -101,6 +101,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
|
|||
|
||||
public TranslationUnit(ICElement parent, URI uri, String idType) {
|
||||
super(parent, (IResource)null, uri.toString(), ICElement.C_UNIT);
|
||||
location= uri;
|
||||
setContentTypeID(idType);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004, 2007 IBM Corporation and others.
|
||||
* Copyright (c) 2004, 2008 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -78,6 +78,9 @@ public class CPPImplicitMethod extends CPPImplicitFunction implements ICPPMethod
|
|||
//first check if we already know it
|
||||
if( declarations != null ){
|
||||
for( int i = 0; i < declarations.length; i++ ){
|
||||
if (declarations[i] == null) {
|
||||
break;
|
||||
}
|
||||
IASTDeclaration decl = (IASTDeclaration) declarations[i].getParent();
|
||||
if( decl.getParent() instanceof ICPPASTCompositeTypeSpecifier )
|
||||
return decl;
|
||||
|
|
Loading…
Add table
Reference in a new issue