File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
src/main/java/fr/adrienbrault/idea/symfony2plugin Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 7
7
import com .intellij .openapi .util .Key ;
8
8
import com .intellij .openapi .util .SimpleModificationTracker ;
9
9
import com .intellij .openapi .util .io .FileUtil ;
10
+ import com .intellij .openapi .vfs .InvalidVirtualFileAccessException ;
10
11
import com .intellij .openapi .vfs .VfsUtil ;
11
12
import com .intellij .openapi .vfs .VirtualFile ;
12
13
import com .intellij .psi .PsiElement ;
@@ -482,8 +483,15 @@ private static Set<String> getDefaultRoutes(@NotNull Project project) {
482
483
Set <String > files = new HashSet <>();
483
484
484
485
// old "app/cache" is ignored for now
485
- VirtualFile cache = VfsUtil .findRelativeFile (projectDir , "var" , "cache" );
486
- for (VirtualFile child : cache != null ? cache .getChildren () : new VirtualFile [] {}) {
486
+ VirtualFile cache = null ;
487
+
488
+ try {
489
+ cache = VfsUtil .findRelativeFile (projectDir , "var" , "cache" );
490
+ } catch (InvalidVirtualFileAccessException ignored ) {
491
+ // "Accessing invalid virtual file"
492
+ }
493
+
494
+ for (VirtualFile child : (cache != null ) ? cache .getChildren () : new VirtualFile []{}) {
487
495
String filename = child .getName ();
488
496
// support "dev" and "dev_*"
489
497
if ("dev" .equals (filename ) || filename .startsWith ("dev_" )) {
Original file line number Diff line number Diff line change 4
4
import com .intellij .openapi .util .Key ;
5
5
import com .intellij .openapi .util .SimpleModificationTracker ;
6
6
import com .intellij .openapi .util .io .FileUtil ;
7
+ import com .intellij .openapi .vfs .InvalidVirtualFileAccessException ;
7
8
import com .intellij .openapi .vfs .VfsUtil ;
8
9
import com .intellij .openapi .vfs .VfsUtilCore ;
9
10
import com .intellij .openapi .vfs .VirtualFile ;
@@ -124,7 +125,13 @@ private static Collection<File> getTranslationRootInner(@NotNull Project project
124
125
Set <String > caches = new HashSet <>();
125
126
126
127
for (String root : new String [] {"var/cache" , "app/cache" }) {
127
- VirtualFile cache = VfsUtil .findRelativeFile (projectDir , root .split ("/" ));
128
+ VirtualFile cache = null ;
129
+ try {
130
+ cache = VfsUtil .findRelativeFile (projectDir , root .split ("/" ));
131
+ } catch (InvalidVirtualFileAccessException ignored ) {
132
+ // "Accessing invalid virtual file"
133
+ }
134
+
128
135
if (cache == null ) {
129
136
continue ;
130
137
}
You can’t perform that action at this time.
0 commit comments