mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-10 12:03:16 +02:00
Fixed a potential NPE.
This commit is contained in:
parent
dcffc2cabf
commit
b2b2a109f5
1 changed files with 4 additions and 2 deletions
|
@ -1004,8 +1004,10 @@ public class IncludeOrganizer {
|
||||||
for (IASTName name : declarations) {
|
for (IASTName name : declarations) {
|
||||||
if (name instanceof IAdaptable) {
|
if (name instanceof IAdaptable) {
|
||||||
IIndexName indexName = (IIndexName) ((IAdaptable) name).getAdapter(IIndexName.class);
|
IIndexName indexName = (IIndexName) ((IAdaptable) name).getAdapter(IIndexName.class);
|
||||||
indexNames = Arrays.copyOf(indexNames, indexNames.length + 1);
|
if (indexName != null) {
|
||||||
indexNames[indexNames.length - 1] = indexName;
|
indexNames = Arrays.copyOf(indexNames, indexNames.length + 1);
|
||||||
|
indexNames[indexNames.length - 1] = indexName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (allowDeclarations || binding instanceof IFunction || binding instanceof IVariable) {
|
} else if (allowDeclarations || binding instanceof IFunction || binding instanceof IVariable) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue