Skip to content

Commit 7f08617

Browse files
updated condition for returning value in the filters encode/decode
1 parent 796310b commit 7f08617

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/Database/Database.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,8 @@ function (?string $value) {
485485
* @return mixed
486486
*/
487487
function (mixed $value) {
488-
if (is_null($value)) {
489-
return;
488+
if (!is_array($value)) {
489+
return $value;
490490
}
491491
try {
492492
return self::encodeSpatialData($value, Database::VAR_POINT);
@@ -499,7 +499,7 @@ function (mixed $value) {
499499
* @return string|null
500500
*/
501501
function (?string $value) {
502-
if (is_null($value)) {
502+
if (!is_string($value)) {
503503
return $value;
504504
}
505505
return self::decodeSpatialData($value);
@@ -4742,7 +4742,6 @@ public function updateDocuments(
47424742
if (!is_null($this->timestamp) && $oldUpdatedAt > $this->timestamp) {
47434743
throw new ConflictException('Document was updated after the request timestamp');
47444744
}
4745-
47464745
$batch[$index] = $this->encode($collection, $document);
47474746
}
47484747

0 commit comments

Comments
 (0)