X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/8e78b4c43eb980f47d9c207a0ce3330699d54103..refs/pull/5280/head:/app/Entities/Controllers/ChapterExportController.php diff --git a/app/Entities/Controllers/ChapterExportController.php b/app/Entities/Controllers/ChapterExportController.php index 0e071fc82..ead601ab4 100644 --- a/app/Entities/Controllers/ChapterExportController.php +++ b/app/Entities/Controllers/ChapterExportController.php @@ -25,7 +25,7 @@ class ChapterExportController extends Controller */ public function pdf(string $bookSlug, string $chapterSlug) { - $chapter = $this->queries->findVisibleBySlugs($bookSlug, $chapterSlug); + $chapter = $this->queries->findVisibleBySlugsOrFail($bookSlug, $chapterSlug); $pdfContent = $this->exportFormatter->chapterToPdf($chapter); return $this->download()->directly($pdfContent, $chapterSlug . '.pdf'); @@ -39,7 +39,7 @@ class ChapterExportController extends Controller */ public function html(string $bookSlug, string $chapterSlug) { - $chapter = $this->queries->findVisibleBySlugs($bookSlug, $chapterSlug); + $chapter = $this->queries->findVisibleBySlugsOrFail($bookSlug, $chapterSlug); $containedHtml = $this->exportFormatter->chapterToContainedHtml($chapter); return $this->download()->directly($containedHtml, $chapterSlug . '.html'); @@ -52,7 +52,7 @@ class ChapterExportController extends Controller */ public function plainText(string $bookSlug, string $chapterSlug) { - $chapter = $this->queries->findVisibleBySlugs($bookSlug, $chapterSlug); + $chapter = $this->queries->findVisibleBySlugsOrFail($bookSlug, $chapterSlug); $chapterText = $this->exportFormatter->chapterToPlainText($chapter); return $this->download()->directly($chapterText, $chapterSlug . '.txt'); @@ -65,7 +65,7 @@ class ChapterExportController extends Controller */ public function markdown(string $bookSlug, string $chapterSlug) { - $chapter = $this->queries->findVisibleBySlugs($bookSlug, $chapterSlug); + $chapter = $this->queries->findVisibleBySlugsOrFail($bookSlug, $chapterSlug); $chapterText = $this->exportFormatter->chapterToMarkdown($chapter); return $this->download()->directly($chapterText, $chapterSlug . '.md');