From: Dan Brown Date: Fri, 9 Jun 2023 18:21:49 +0000 (+0100) Subject: Fixed error on pages without comments X-Git-Tag: v23.06~1^2~29 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/59c7077fd93ae6842d37c07bcb9e27d7ddc27050 Fixed error on pages without comments --- diff --git a/app/Activity/Tools/CommentTree.php b/app/Activity/Tools/CommentTree.php index 559edccf3..3303add39 100644 --- a/app/Activity/Tools/CommentTree.php +++ b/app/Activity/Tools/CommentTree.php @@ -65,7 +65,7 @@ class CommentTree } $tree = []; - foreach ($childMap[0] as $childId) { + foreach ($childMap[0] ?? [] as $childId) { $tree[] = $this->createTreeForId($childId, 0, $byId, $childMap); }