mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't throw InvalidVirtualFileAccessException from refreshAndFindFileByPath
GitOrigin-RevId: fecb42a47d5f0e0b3c2f35663b8eeb9e39f07a8b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
afc89639cf
commit
501c21024d
+10
-1
@@ -106,7 +106,7 @@ public class VirtualDirectoryImpl extends VirtualFileSystemEntry {
|
||||
return null;
|
||||
}
|
||||
if (!isValid()) {
|
||||
throw new InvalidVirtualFileAccessException(this);
|
||||
return handleInvalidDirectory();
|
||||
}
|
||||
|
||||
VirtualFileSystemEntry found = doFindChildInArray(name, caseSensitive);
|
||||
@@ -170,6 +170,15 @@ public class VirtualDirectoryImpl extends VirtualFileSystemEntry {
|
||||
return child;
|
||||
}
|
||||
|
||||
private VirtualFileSystemEntry handleInvalidDirectory() {
|
||||
if (!ApplicationManager.getApplication().isReadAccessAllowed()) {
|
||||
// We can be inside refreshAndFindFileByPath, which must be called outside read action, and
|
||||
// throwing an exception doesn't seem a good idea when the callers can't do anything about it
|
||||
return null;
|
||||
}
|
||||
throw new InvalidVirtualFileAccessException(this);
|
||||
}
|
||||
|
||||
// removes forward/back slashes from start/end and return trimmed name or null if there are slashes in the middle or it's empty
|
||||
private static String deSlash(@NotNull String name) {
|
||||
int startTrimmed = -1;
|
||||
|
||||
Reference in New Issue
Block a user