Skip to content

Commit

Permalink
ServiceController: throw 404
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas-Gelf committed Jul 19, 2022
1 parent cb58573 commit 349cc33
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions application/controllers/ServiceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Icinga\Module\Director\Controllers;

use Exception;
use Icinga\Exception\NotFoundError;
use Icinga\Module\Director\Data\Db\DbObjectStore;
use Icinga\Module\Director\Data\Db\DbObjectTypeRegistry;
use Icinga\Module\Director\Db\Branch\UuidLookup;
Expand Down Expand Up @@ -252,6 +253,9 @@ protected function loadObject()
$key = $this->getLegacyKey();
// Hint: not passing 'object' as type, we still have name-based links in previews and similar
$uuid = UuidLookup::findServiceUuid($this->db(), $this->getBranch(), null, $key, $this->host, $this->set);
if ($uuid === null) {
throw new NotFoundError('Not found');
}
$this->params->set('uuid', $uuid->toString());
parent::loadObject();
}
Expand Down

0 comments on commit 349cc33

Please sign in to comment.