]> BookStack Code Mirror - bookstack/commitdiff
Fixed error on pages without comments
authorDan Brown <redacted>
Fri, 9 Jun 2023 18:21:49 +0000 (19:21 +0100)
committerDan Brown <redacted>
Fri, 9 Jun 2023 18:21:49 +0000 (19:21 +0100)
app/Activity/Tools/CommentTree.php

index 559edccf3218c8f0cfc18e8c10658b6912a932d1..3303add39b891ca69b6ef9694f5d5af102ea9dc7 100644 (file)
@@ -65,7 +65,7 @@ class CommentTree
         }
 
         $tree = [];
-        foreach ($childMap[0] as $childId) {
+        foreach ($childMap[0] ?? [] as $childId) {
             $tree[] = $this->createTreeForId($childId, 0, $byId, $childMap);
         }