Skip to content
This repository was archived by the owner on May 18, 2020. It is now read-only.

Commit 53297cf

Browse files
committed
Add runtime exception for the rare case, if NULL in response
1 parent 519df86 commit 53297cf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

V2.0/Mailin.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ private function do_request($resource,$method,$input)
4949
{
5050
throw new RuntimeException('cURL error: ' . curl_error($ch));
5151
}
52+
if(!is_string($data) || !strlen($data)) {
53+
throw new RuntimeException('Request Failed');
54+
}
5255
curl_close($ch);
5356
return json_decode($data,true);
5457
}

0 commit comments

Comments
 (0)