Skip to content

Commit 81b4807

Browse files
[Autocomplete] Avoid handling InvalidArgumentException
1 parent a346940 commit 81b4807

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Autocomplete/src/Doctrine/EntityMetadata.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ public function getAssociationMetadata(string $propertyName): array
8484

8585
public function getPropertyDataType(string $propertyName): string
8686
{
87-
try {
87+
if (\array_key_exists($propertyName, $this->metadata->fieldMappings)) {
8888
return $this->getFieldMetadata($propertyName)['type'];
89-
} catch (\InvalidArgumentException $e) {
90-
return $this->getAssociationMetadata($propertyName)['type'];
9189
}
90+
91+
return $this->getAssociationMetadata($propertyName)['type'];
9292
}
9393

9494
public function getIdValue(object $entity): string

0 commit comments

Comments
 (0)