Skip to content

Commit

Permalink
Fix issue if method doesn’t exist
Browse files Browse the repository at this point in the history
  • Loading branch information
aerni committed Jul 19, 2024
1 parent a81716c commit c5ba9a5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Sitemaps/SitemapRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ public function find(string $id): ?Sitemap
{
$method = Str::before($id, '::').'Sitemaps';

if (! method_exists($this, $method)) {
return null;
}

return $this->$method()->first(fn ($sitemap) => $id === $sitemap->id());
}

Expand Down

0 comments on commit c5ba9a5

Please sign in to comment.