From 3db33dbcaac05b263f37cc17abb73a2a9b765d5c Mon Sep 17 00:00:00 2001 From: cranetm Date: Wed, 27 Jan 2016 10:29:25 +0200 Subject: [PATCH] Fixed issue with zero request id --- JsonRpc2/Controller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/JsonRpc2/Controller.php b/JsonRpc2/Controller.php index 91de207..5e7ad1f 100644 --- a/JsonRpc2/Controller.php +++ b/JsonRpc2/Controller.php @@ -87,7 +87,7 @@ private function getActionResponse($requestObject) if (!isset($this->requestObject->id) && (empty($error) || !in_array($error->getCode(), [Exception::PARSE_ERROR, Exception::INVALID_REQUEST]))) return null; - return Helper::formatResponse($result, $error, !empty($this->requestObject->id)? $this->requestObject->id : null); + return Helper::formatResponse($result, $error, !isset($this->requestObject->id)? $this->requestObject->id : null); } /** @@ -352,4 +352,4 @@ private function parseMethodDocComment($method) unset($subject); } } -} \ No newline at end of file +}