Skip to content

Commit bb90b90

Browse files
committed
fix(entity): handle empty string values in property type check
- Added a condition to check for empty string values in the property type validation - Ensures that only non-empty strings are processed for entity creation
1 parent 16df201 commit bb90b90

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Factory/EntityFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ class: $value[\Spameri\Elastic\Model\Insert\PrepareEntityArray::ENTITY_CLASS],
245245
} elseif (
246246
isset(\class_implements($propertyTypeName)[\Spameri\Elastic\Entity\ElasticEntityInterface::class]) === true
247247
&& \is_string($value) === true
248+
&& $value !== ''
248249
) {
249250
if (isset($this->identityMap->creatingEntityList[$propertyTypeName][$value])) {
250251
$propertyValue = eval("return (new class() extends $propertyTypeName {public function __construct(){}});");

0 commit comments

Comments
 (0)