diff --git a/src/FusionDirectory/Rest/WebServiceCall.php b/src/FusionDirectory/Rest/WebServiceCall.php index 232e8553a3b9bf07fcd0330f1d29079c337885d0..d0359690af4c7a93a9c38753a6591c01fe828e08 100644 --- a/src/FusionDirectory/Rest/WebServiceCall.php +++ b/src/FusionDirectory/Rest/WebServiceCall.php @@ -199,19 +199,22 @@ class WebServiceCall return $response; } - /** +/** * @return array - * @throws Exception + * @throws \Exception */ public function execute(): array { - $this->setCurlSettings(); $response = curl_exec($this->ch); $this->handleCurlError($this->ch); $decoded = json_decode($response, true); curl_close($this->ch); + if (!is_array($decoded)) { + throw new \Exception('Invalid JSON response: ' . $response); + } + return $decoded; }