From b4999fcc8336b69adc67ed85a4322af6fd6bbc7c Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Tue, 8 Oct 2019 18:01:59 +0200 Subject: [PATCH] Throw exception if domain used to call Certificates.get() does not have a certificate, fixes #722 Signed-off-by: Michael Kaufmann --- lib/Froxlor/Api/Commands/Certificates.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Froxlor/Api/Commands/Certificates.php b/lib/Froxlor/Api/Commands/Certificates.php index a725a969..1d73bb54 100644 --- a/lib/Froxlor/Api/Commands/Certificates.php +++ b/lib/Froxlor/Api/Commands/Certificates.php @@ -110,6 +110,9 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou $result = Database::pexecute_first($stmt, array( "domainid" => $domainid )); + if (! $result) { + throw new \Exception("Domain '" . $domain['domain'] . "' does not have a certificate.", 404); + } return $this->response(200, "successfull", $result); }