1
0
Fork 0
mirror of https://codeberg.org/demostf/api.git synced 2026-06-03 09:54:17 +02:00

proper error for setting url of unknown demo

This commit is contained in:
Robin Appelman 2022-05-15 16:03:33 +02:00
commit bebf6cfbd5

View file

@ -145,6 +145,10 @@ class DemoController extends BaseController {
}
$demo = $this->demoProvider->get((int) $id);
if (!$demo) {
throw new NotFoundException("Demo not found");
}
$existingHash = $demo->getHash();
if ('' === $existingHash || $existingHash === $hash) {
$this->demoProvider->setDemoUrl((int) $id, $backend, $url, $path);