Skip to content

Commit

Permalink
Return 404 for collection-items request if collection doesn't exist
Browse files Browse the repository at this point in the history
Rather than failing with a 500
  • Loading branch information
dstillman committed Jan 16, 2021
1 parent fdfb097 commit 324f9f5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions controllers/TagsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ public function tags() {
$empty = false;
if ($this->scopeObject == 'collection-items') {
$collection = Zotero_Collections::getByLibraryAndKey($this->objectLibraryID, $this->scopeObjectKey);
if (!$collection) {
$this->e404();
}
$itemIDs = $collection->getItems(true);
$itemParams['itemIDs'] = $itemIDs;
if (!$itemIDs) {
Expand Down

0 comments on commit 324f9f5

Please sign in to comment.