1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-26 10:25:32 +02:00

[187732] if file doesn't exist, don't try to get the parent

This commit is contained in:
David McKnight 2007-05-23 16:03:08 +00:00
parent 59c2b899a3
commit 9e9213cb95

View file

@ -569,12 +569,16 @@ public class SystemViewRemoteFileAdapter
{ {
//System.out.println("Inside getParent for: "+element); //System.out.println("Inside getParent for: "+element);
IRemoteFile file = (IRemoteFile) element; IRemoteFile file = (IRemoteFile) element;
if (file.exists())
{
IRemoteFile parent = file.getParentRemoteFile(); IRemoteFile parent = file.getParentRemoteFile();
if ((parent != null) && parent.getAbsolutePath().equals(file.getAbsolutePath())) if ((parent != null) && parent.getAbsolutePath().equals(file.getAbsolutePath()))
// should never happen but sometimes it does, leading to infinite loop. // should never happen but sometimes it does, leading to infinite loop.
parent = null; parent = null;
return parent; return parent;
} }
return null;
}
/** /**
* Return the children of this object. * Return the children of this object.