diff --git a/lib/Exception/BlockChypException.php b/lib/Exception/BlockChypException.php index a6c42ed..6c720a8 100644 --- a/lib/Exception/BlockChypException.php +++ b/lib/Exception/BlockChypException.php @@ -24,7 +24,10 @@ public static function factory($message, $httpStatus = null, $httpBody = null) $instance = new static($message); $instance->setHttpStatus($httpStatus); $instance->setHttpBody($httpBody); - $instance->setJsonBody(json_decode($httpBody, true)); + if (isset($httpBody)) { + $httpBody = json_decode($httpBody, true); + } + $instance->setJsonBody($httpBody); return $instance; }