Repository: EasyCorp/EasyAdminBundle (language: php)

Issue:
RenderFilters crashes when EntityDto->Instance is not set on Symfony 6.4
**Describe the bug**
A crash from PropertyAccessor via AssociationConfigurator

**To Reproduce**
Unsure exactly, but it appears that when a null instance is passed to EntityDto and RenderFilters is called, AssociationConfigurator will always attempt accessing the value from EntityDto, however as PropertyAccessor in symfony 6.4 uses a hard `object|array` typing this will then cause a `TypeError` which isn't caught by AssociationConfigurator (only catches `UnexpectedTypeException`)

**(OPTIONAL) Additional context**
https://github.com/EasyCorp/EasyAdminBundle/blob/f63e526f65219f26a3add5020a6021a0f5e29e26/src/Field/Configurator/AssociationConfigurator.php#L121

This line should be preceded by a` if(null !== $entityDto->getInstance())` check to prevent the crash, I'll make a fork shortly.



Discussion / hints:

Fix patch:
diff --git a/src/Field/Configurator/AssociationConfigurator.php b/src/Field/Configurator/AssociationConfigurator.php
index e5f8702038..755f75bcd5 100644
--- a/src/Field/Configurator/AssociationConfigurator.php
+++ b/src/Field/Configurator/AssociationConfigurator.php
@@ -118,11 +118,13 @@ public function configure(FieldDto $field, EntityDto $entityDto, AdminContext $c
             $field->setFormTypeOptionIfNotSet('class', $targetEntityFqcn);
 
             try {
-                $relatedEntityId = $accessor->getValue($entityDto->getInstance(), $propertyName.'.'.$metadata->getIdentifierFieldNames()[0]);
-                $relatedEntityDto = $this->entityFactory->create($targetEntityFqcn, $relatedEntityId);
+                if (null !== $entityDto->getInstance()) {
+                    $relatedEntityId = $accessor->getValue($entityDto->getInstance(), $propertyName.'.'.$metadata->getIdentifierFieldNames()[0]);
+                    $relatedEntityDto = $this->entityFactory->create($targetEntityFqcn, $relatedEntityId);
 
-                $field->setCustomOption(AssociationField::OPTION_RELATED_URL, $this->generateLinkToAssociatedEntity($targetCrudControllerFqcn, $relatedEntityDto));
-                $field->setFormattedValue($this->formatAsString($relatedEntityDto->getInstance(), $relatedEntityDto));
+                    $field->setCustomOption(AssociationField::OPTION_RELATED_URL, $this->generateLinkToAssociatedEntity($targetCrudControllerFqcn, $relatedEntityDto));
+                    $field->setFormattedValue($this->formatAsString($relatedEntityDto->getInstance(), $relatedEntityDto));
+                }
             } catch (UnexpectedTypeException) {
                 // this may crash if something in the tree is null, so just do nothing then
             }


Test patch: