Skip to content

Commit 540fa34

Browse files
committed
MagicFields fix
1 parent e043367 commit 540fa34

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cz/juzna/intellij/nette/utils/MagicFieldsUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ public static PhpType extractTypeFromMethodTypes(@NotNull Collection<Method> typ
4444

4545
@NotNull
4646
public static HashMap<String, Collection<Method>> findMagicFields(MemberReference reference, PhpIndex phpIndex) {
47-
PhpType type = reference.getType();
47+
PhpType type = reference.getClassReference() != null ? reference.getClassReference().getType() : null;
4848

4949
HashMap<String, Collection<Method>> fields = new HashMap<String, Collection<Method>>();
50-
if (!(new PhpType().add("Nette\\Object")).isConvertibleFrom(type, phpIndex)) {
50+
if (type == null || !(new PhpType().add("Nette\\Object")).isConvertibleFrom(type, phpIndex)) {
5151
return fields;
5252
}
5353
for (PhpClass cls : PhpIndexUtil.getClasses(type, phpIndex)) {

0 commit comments

Comments
 (0)