File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/com/magento/idea/magento2plugin/stubs/indexes/graphql Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 8
8
import com .intellij .lang .jsgraphql .psi .*;
9
9
import com .intellij .openapi .vfs .VirtualFile ;
10
10
import com .intellij .psi .PsiElement ;
11
+ import com .intellij .psi .PsiFile ;
11
12
import com .intellij .psi .PsiManager ;
12
13
import com .intellij .psi .search .GlobalSearchScope ;
13
14
import com .intellij .util .indexing .*;
@@ -127,10 +128,12 @@ public static List<GraphQLQuotedString> getGraphQLUsages(@NotNull PhpClass phpCl
127
128
128
129
PsiManager psiManager = PsiManager .getInstance (phpClass .getProject ());
129
130
for (VirtualFile virtualFile : containingFiles ) {
130
- GraphQLFile file = (GraphQLFile ) psiManager .findFile (virtualFile );
131
- if (file == null ) {
131
+ final PsiFile fileCandidate = psiManager .findFile (virtualFile );
132
+
133
+ if (!(fileCandidate instanceof GraphQLFile )) {
132
134
continue ;
133
135
}
136
+ GraphQLFile file = (GraphQLFile ) fileCandidate ;
134
137
PsiElement [] children = file .getChildren ();
135
138
findMatchingQuotedString (children , classFqn , quotedStrings );
136
139
}
You can’t perform that action at this time.
0 commit comments