Skip to content

Commit

Permalink
[TASK] Check return type of findByUid in PostRepository
Browse files Browse the repository at this point in the history
  • Loading branch information
bnf committed Oct 17, 2024
1 parent 3dfca4f commit fa00afa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Classes/Domain/Repository/PostRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,11 @@ public function findRelatedPosts(int $categoryMultiplier = 1, int $tagMultiplier
if ($i === $limit) {
break;
}
$posts->attach($this->findByUid($selectedPost));
$post = $this->findByUid($selectedPost);
if ($post === null) {
continue;
}
$posts->attach($post);
$i++;
}

Expand Down

0 comments on commit fa00afa

Please sign in to comment.