From 38c23997b361d707e9fa037e4a0fed3c2ac77673 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Wed, 12 Oct 2016 11:33:20 +0200 Subject: [PATCH] [platform] corrupted paths tolerance in VFS (EA-89728) --- .../newvfs/persistent/PersistentFSImpl.java | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java index 5195d1711a40..24d461d9d273 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFSImpl.java @@ -860,19 +860,22 @@ public class PersistentFSImpl extends PersistentFS implements ApplicationCompone canonicalBasePath = basePath; } - FileAttributes attributes = fs.getAttributes(new StubVirtualFile() { - @NotNull - @Override - public String getPath() { - return canonicalBasePath; - } + FileAttributes attributes; + try { + attributes = fs.getAttributes(new StubVirtualFile() { + @NotNull + @Override + public String getPath() { return canonicalBasePath; } - @Nullable - @Override - public VirtualFile getParent() { - return null; - } - }); + @Nullable + @Override + public VirtualFile getParent() { return null; } + }); + } + catch (RuntimeException | AssertionError e) { + LOG.error(e); + return null; + } if (attributes == null || !attributes.isDirectory()) { return null; }