Skip to content

Commit

Permalink
fix "FormFieldResolver.visitFormReferencesFields must not be null"
Browse files Browse the repository at this point in the history
  • Loading branch information
Haehnchen committed Apr 20, 2024
1 parent 91c0892 commit 8e4684d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ public void resolve(Collection<TwigTypeContainer> targets, Collection<TwigTypeCo

TwigTypeContainer twigTypeContainer = targets.iterator().next();
if (twigTypeContainer.getPhpNamedElement() instanceof PhpClass phpClass && isFormView(phpClass)) {
visitFormReferencesFields(psiVariables.iterator().next().getElement(), targets::add);
PsiElement element = psiVariables.iterator().next().getElement();
if (element != null) {
visitFormReferencesFields(element, targets::add);
}
}
}

Expand All @@ -51,6 +54,7 @@ public static boolean isFormView(@NotNull PhpType phpType) {
);
}

@NotNull
public static Collection<PhpClass> getFormTypeFromFormFactory(@NotNull PsiElement formReference) {
Collection<PhpClass> phpClasses = new ArrayList<>();

Expand Down

0 comments on commit 8e4684d

Please sign in to comment.