Skip to content

Commit

Permalink
fix: handle missing inbox
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricerenck committed Mar 4, 2024
1 parent 346a3df commit 2f539e4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions utils/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,18 @@ public function getAllCommentsOfPage($page)

if (count($languageCodes) === 0) {
$inbox = $this->getInboxByLanguage($page);
$inboxes->add($inbox->toStructure());
if (!is_null($inbox)) {
$inboxes->add($inbox->toStructure());
}

return $inboxes;
}

foreach ($languageCodes as $language) {
$inbox = $this->getInboxByLanguage($page, $language);
$inboxes->add($inbox->toStructure());
if (!is_null($inbox)) {
$inboxes->add($inbox->toStructure());
}
}

return $inboxes;
Expand Down

0 comments on commit 2f539e4

Please sign in to comment.