Skip to content

Commit

Permalink
fix: undefined array index
Browse files Browse the repository at this point in the history
  • Loading branch information
yilanboy committed Nov 13, 2024
1 parent edd8101 commit 7d36a8e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/Livewire/Shared/Comments/CommentList.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,12 @@ private function getComments(int $skip): array
->toArray();

foreach ($comments as &$comment) {
if (is_null($comment['user'])) {
continue;
}

$comment['converted_body'] = $this->convertToHtml($comment['body']);

$comment['user']['gravatar_url'] = get_gravatar($comment['user']['email']);
unset($comment['user']['email']);
if (! is_null($comment['user'])) {
$comment['user']['gravatar_url'] = get_gravatar($comment['user']['email']);
unset($comment['user']['email']);
}
}

return $comments;
Expand Down

0 comments on commit 7d36a8e

Please sign in to comment.