Skip to content

Commit

Permalink
Throw NotFound when a poster image doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
gmemstr committed Aug 23, 2024
1 parent a799201 commit 979e18e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions backend/src/Controller/Posters/GetPosterAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,9 @@ public function __invoke(
);
}

// Default poster if no other image is found.
// Return 404 if poster image isn't found
if (null === $image) {
$image = file_get_contents(
Environment::getBaseDirectory() . '/web/static/img/no_poster.jpg'
);
throw NotFoundException::poster($request);

Check failure on line 145 in backend/src/Controller/Posters/GetPosterAction.php

View workflow job for this annotation

GitHub Actions / Build and Test

Call to static method poster() on an unknown class App\Controller\Posters\NotFoundException.

Check failure on line 145 in backend/src/Controller/Posters/GetPosterAction.php

View workflow job for this annotation

GitHub Actions / Build and Test

Call to static method poster() on an unknown class App\Controller\Posters\NotFoundException.
}

$response->getBody()->write($image);
Expand Down

0 comments on commit 979e18e

Please sign in to comment.