Skip to content

Commit 3596211

Browse files
654: Fixed class cast exception
1 parent f020efa commit 3596211

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/com/magento/idea/magento2plugin/stubs/indexes/WebApiTypeIndex.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,9 @@ public static List<XmlTag> getWebApiRoutes(final Method method) {
135135
}
136136
final String classFqn = phpClass.getPresentableFQN();
137137
final Collection<VirtualFile> containingFiles = FileBasedIndex
138-
.getInstance().getContainingFiles(
139-
KEY,
138+
.getInstance()
139+
.getContainingFiles(
140+
KEY,
140141
classFqn,
141142
GlobalSearchScope.allScope(phpClass.getProject())
142143
);
@@ -145,12 +146,19 @@ public static List<XmlTag> getWebApiRoutes(final Method method) {
145146
final String methodFqn = method.getName();
146147

147148
for (final VirtualFile virtualFile : containingFiles) {
149+
if (!(virtualFile instanceof XmlFile)) {
150+
continue;
151+
}
148152
final XmlFile file = (XmlFile) psiManager.findFile(virtualFile);
149153

150154
if (file == null) {
151155
continue;
152156
}
153157
final XmlTag rootTag = file.getRootTag();
158+
159+
if (rootTag == null) {
160+
continue;
161+
}
154162
fillRelatedTags(classFqn, methodFqn, rootTag, tags);
155163
}
156164

0 commit comments

Comments
 (0)