mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Avoid NPE when trying to create an ICElement from an inaccessible IResource
This commit is contained in:
parent
25f1b2bdc3
commit
c3234a4552
1 changed files with 6 additions and 3 deletions
|
@ -314,12 +314,15 @@ public class CNavigatorContentProvider extends CViewContentProvider implements I
|
||||||
for (Iterator iter= currentChildren.iterator(); iter.hasNext();) {
|
for (Iterator iter= currentChildren.iterator(); iter.hasNext();) {
|
||||||
Object child= iter.next();
|
Object child= iter.next();
|
||||||
if (child instanceof IResource) {
|
if (child instanceof IResource) {
|
||||||
|
IResource resource= (IResource)child;
|
||||||
|
if (resource.isAccessible()) {
|
||||||
if ((newChild= CoreModel.getDefault().create((IResource) child)) != null) {
|
if ((newChild= CoreModel.getDefault().create((IResource) child)) != null) {
|
||||||
iter.remove();
|
iter.remove();
|
||||||
convertedChildren.add(newChild);
|
convertedChildren.add(newChild);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!convertedChildren.isEmpty()) {
|
if (!convertedChildren.isEmpty()) {
|
||||||
currentChildren.addAll(convertedChildren);
|
currentChildren.addAll(convertedChildren);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue