diff --git a/src/ORM/Rule/ExistsIn.php b/src/ORM/Rule/ExistsIn.php index ec96838a86f..7b40f49009a 100644 --- a/src/ORM/Rule/ExistsIn.php +++ b/src/ORM/Rule/ExistsIn.php @@ -65,7 +65,7 @@ public function __invoke(EntityInterface $entity, array $options) { if (is_string($this->_repository)) { $repository = $options['repository']->association($this->_repository); - if (empty($repository)) { + if (!$repository) { throw new RuntimeException(sprintf( "ExistsIn rule for '%s' is invalid. The '%s' association is not defined.", implode(', ', $this->_fields),