Skip to content

Commit 23c0244

Browse files
committed
Check json_decode parameter
1 parent 7513de0 commit 23c0244

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Adyen/HttpClient/CurlClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,8 @@ public function requestHttp(Service $service, $requestUrl, $params, $method, $re
365365

366366
// Result in array or json
367367
if ($config->getOutputType() == 'array') {
368-
// Transform to PHP Array
369-
$result = json_decode($result, true);
368+
// Transform to PHP Array if $result is a valid JSON string
369+
$result = is_string($result) ? json_decode($result, true) : null;
370370
}
371371

372372
return $result;

0 commit comments

Comments
 (0)