Return 404 if the comic is not found

This commit is contained in:
Luis Ángel San Martín
2024-08-29 19:01:48 +02:00
parent c5924e625b
commit a3f3149764
4 changed files with 27 additions and 3 deletions

View File

@ -57,6 +57,12 @@ void ComicControllerV2::service(HttpRequest &request, HttpResponse &response)
ComicDB comic = DBHelper::getComicInfo(libraryId, comicId);
if (!comic.info.existOnDb) {
response.setStatus(404, "Not Found");
response.write("", true);
return;
}
Comic *comicFile = FactoryComic::newComic(libraries.getPath(libraryId) + comic.path);
if (comicFile != nullptr) {