fix prefinery bug

This commit is contained in:
Alex Grintsvayg 2016-10-12 16:29:51 -04:00
parent 04eb283bf2
commit 785183a633

View file

@ -149,15 +149,8 @@ class Prefinery
);
}
protected static function decodePrefineryResponse($rawBody, $allowEmptyResponse = true)
protected static function decodePrefineryResponse($data, $allowEmptyResponse = true)
{
if (!$rawBody)
{
throw new PrefineryException('Empty cURL response.');
}
$data = json_decode($rawBody, true);
if (!$allowEmptyResponse && !$data && $data !== [])
{
throw new PrefineryException('Received empty or improperly encoded response.');