diff options
-rw-r--r-- | core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/parser/BinaryContainerAdapter.java | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/parser/BinaryContainerAdapter.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/parser/BinaryContainerAdapter.java index 4d20d8f36bd..a322d9f32f6 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/parser/BinaryContainerAdapter.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/parser/BinaryContainerAdapter.java @@ -137,11 +137,14 @@ public class BinaryContainerAdapter extends Container implements IFolder { if (f == null) { // Pass it to parent to create a fake/phantom if the object // is not in the archive. - f = getParent().getFile(path); - // Add it to the list of phantoms - if (! phantomResources.contains(f)) { - phantomResources.add(f); - phantomResources.trimToSize(); + IContainer container = getParent(); + if (container != null) { + f = container.getFile(path); + // Add it to the list of phantoms + if (! phantomResources.contains(f)) { + phantomResources.add(f); + phantomResources.trimToSize(); + } } } return f; @@ -176,10 +179,14 @@ public class BinaryContainerAdapter extends Container implements IFolder { public IFolder getFolder(IPath path) { // Only Files in the archive pass this to the parent // to create a phatom resource - IFolder f = getParent().getFolder(path); - if (!phantomResources.contains(f)) { - phantomResources.add(f); - phantomResources.trimToSize(); + IFolder f = null; + IContainer container = getParent(); + if (container != null) { + f = container.getFolder(path); + if (!phantomResources.contains(f)) { + phantomResources.add(f); + phantomResources.trimToSize(); + } } return f; } |