From 91de712216bc35fc81dfe84ac2048be21a781b14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Sch=C3=BCle?= Date: Wed, 5 Jun 2019 09:57:05 +0200 Subject: [PATCH] fix(JsonClient): throw exception if services is not set to prevent "Undefined index: services" --- library/Zend/Json/Client/SMD.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/library/Zend/Json/Client/SMD.php b/library/Zend/Json/Client/SMD.php index 484134034..20cea717a 100644 --- a/library/Zend/Json/Client/SMD.php +++ b/library/Zend/Json/Client/SMD.php @@ -56,7 +56,16 @@ public function loadJson($json) */ public function getMethodSignature($method) { - if(!(isset($this->_smd['services'][$method]) || array_key_exists($method, $this->_smd['services']))) { + if (!isset($this->_smd['services'])) { + /** + * Exception thrown when method not found + * @see Zend_Json_Client_IntrospectException + */ + require_once 'Zend/Json/Client/IntrospectException.php'; + throw new Zend_Json_Client_IntrospectException("no services found in smd"); + } + + if (!(isset($this->_smd['services'][$method]) || array_key_exists($method, $this->_smd['services']))) { /** * Exception thrown when method not found * @see Zend_Json_Client_IntrospectException