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 +}