Skip to content

Commit 3836113

Browse files
author
子旭 苏
committed
fix null parameter bug
1 parent f8b2273 commit 3836113

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Predicate/Exists.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ public function setExists(string|Select|Expression $exists, mixed ...$valueParam
3232
if (! empty($valueParameter)) {
3333
$valueParameter1 = current($valueParameter);
3434
$valueParameterArray = is_array($valueParameter1) ? $valueParameter1 : $valueParameter;
35+
$exists = new Expression($exists, $valueParameterArray);
3536
} else {
36-
$valueParameterArray = null;
37+
$exists = new Expression($exists);
3738
}
38-
$exists = new Expression($exists, $valueParameterArray);
3939
} elseif (! $exists instanceof Select && ! $exists instanceof Expression) {
4040
throw new Exception\InvalidArgumentException('$exists must be either an string, a Sql\Select object or a Sql\Expression object, ' .
4141
gettype($exists) . ' given');

0 commit comments

Comments
 (0)