Skip to content

Commit 5cb500f

Browse files
committed
fixing possible npw in PhpEventDispatcherGotoCompletionRegistrar
1 parent 8c423e6 commit 5cb500f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/fr/adrienbrault/idea/symfony2plugin/config/php/PhpEventDispatcherGotoCompletionRegistrar.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,13 @@ public GotoCompletionProvider getProvider(@NotNull PsiElement psiElement) {
5151
PhpReturn phpReturn = PsiTreeUtil.getParentOfType(arrayValue, PhpReturn.class);
5252
if(phpReturn != null) {
5353
Method method = PsiTreeUtil.getParentOfType(arrayValue, Method.class);
54-
String name = method.getName();
55-
if(method != null && "getSubscribedEvents".equals(name)) {
56-
PhpClass containingClass = method.getContainingClass();
57-
if(containingClass != null && new Symfony2InterfacesUtil().isInstanceOf(containingClass, "\\Symfony\\Component\\EventDispatcher\\EventSubscriberInterface")) {
58-
return new PhpClassPublicMethodProvider(containingClass);
54+
if(method != null) {
55+
String name = method.getName();
56+
if("getSubscribedEvents".equals(name)) {
57+
PhpClass containingClass = method.getContainingClass();
58+
if(containingClass != null && new Symfony2InterfacesUtil().isInstanceOf(containingClass, "\\Symfony\\Component\\EventDispatcher\\EventSubscriberInterface")) {
59+
return new PhpClassPublicMethodProvider(containingClass);
60+
}
5961
}
6062
}
6163
}

0 commit comments

Comments
 (0)