1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 07:05:24 +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,11 +569,15 @@ public class SystemViewRemoteFileAdapter
{
//System.out.println("Inside getParent for: "+element);
IRemoteFile file = (IRemoteFile) element;
IRemoteFile parent = file.getParentRemoteFile();
if ((parent != null) && parent.getAbsolutePath().equals(file.getAbsolutePath()))
// should never happen but sometimes it does, leading to infinite loop.
parent = null;
return parent;
if (file.exists())
{
IRemoteFile parent = file.getParentRemoteFile();
if ((parent != null) && parent.getAbsolutePath().equals(file.getAbsolutePath()))
// should never happen but sometimes it does, leading to infinite loop.
parent = null;
return parent;
}
return null;
}
/**