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

Commit

Permalink
Add runtime exception for the rare case, if NULL in response
Browse files Browse the repository at this point in the history
  • Loading branch information
ekta-slit committed Jun 30, 2016
1 parent 519df86 commit 53297cf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions V2.0/Mailin.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ private function do_request($resource,$method,$input)
{
throw new RuntimeException('cURL error: ' . curl_error($ch));
}
if(!is_string($data) || !strlen($data)) {
throw new RuntimeException('Request Failed');
}
curl_close($ch);
return json_decode($data,true);
}
Expand Down

0 comments on commit 53297cf

Please sign in to comment.