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]],