Skip to content

Commit 8ff1147

Browse files
committed
If a taxonomy doesnt exists, fail early. Closes #1009
1 parent b6013c8 commit 8ff1147

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Stache/Repositories/TermRepository.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ public function findByUri(string $uri, string $site = null): ?Term
6262
return null;
6363
}
6464

65+
if (! Taxonomy::handleExists($taxonomy)) {
66+
return null;
67+
}
68+
6569
$term = $this->query()
6670
->where('slug', $slug)
6771
->where('taxonomy', $taxonomy)

0 commit comments

Comments
 (0)