From fe0810a89e3fadca9b1e3777d364432633b177cb Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sun, 28 Apr 2024 16:15:47 +0200 Subject: [PATCH] Fix error when images are NULL --- src/main/php/de/thekid/dialog/Repository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/php/de/thekid/dialog/Repository.php b/src/main/php/de/thekid/dialog/Repository.php index 1a4c914..7df4e1e 100755 --- a/src/main/php/de/thekid/dialog/Repository.php +++ b/src/main/php/de/thekid/dialog/Repository.php @@ -53,7 +53,7 @@ public function entries(Pagination $pagination, int $page, int $children= 6): ar // If no preview images are set, aggregate children ['$lookup' => [ 'from' => 'entries', - 'let' => ['parent' => '$slug', 'images' => ['$size' => '$images']], + 'let' => ['parent' => '$slug', 'images' => ['$size' => ['$ifNull' => ['$images', []]]]], 'pipeline' => [ ['$match' => ['$expr' => ['$cond' => [ ['$eq' => ['$$images', 0]],