Skip to content

Commit 9f08165

Browse files
author
Laurynas Butkus
committed
Handle empty API response
1 parent c57e250 commit 9f08165

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/ConvertApi/Client.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ private function handleCurlError($ch)
137137

138138
private function checkResponse($ch, $response)
139139
{
140+
if (empty($response))
141+
throw new Error\Api('API response is empty');
142+
140143
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
141144

142145
if ($http_code == 200)

0 commit comments

Comments
 (0)