Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dbcdc1d

Browse files
committed
Empty identifiers must be disallowed
1 parent 0d82128 commit dbcdc1d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/Doctrine/ORM/UnitOfWork.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1400,7 +1400,7 @@ public function addToIdentityMap($entity)
14001400
$classMetadata = $this->em->getClassMetadata(get_class($entity));
14011401
$identifier = $this->entityIdentifiers[spl_object_hash($entity)];
14021402

1403-
if (in_array(null, $identifier, true)) {
1403+
if (empty($identifier) || in_array(null, $identifier, true)) {
14041404
throw ORMInvalidArgumentException::entityWithoutIdentity($classMetadata->name, $entity);
14051405
}
14061406

0 commit comments

Comments
 (0)