mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Accounted for non-existant entities
This commit is contained in:
@@ -56,7 +56,9 @@ class ChapterRepo
|
||||
*/
|
||||
public function getBySlug($slug, $bookId)
|
||||
{
|
||||
return $this->chapter->where('slug', '=', $slug)->where('book_id', '=', $bookId)->first();
|
||||
$chapter = $this->chapter->where('slug', '=', $slug)->where('book_id', '=', $bookId)->first();
|
||||
if ($chapter === null) abort(404);
|
||||
return $chapter;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user