Skip to content

Commit

Permalink
Ensure a string return by curlExec
Browse files Browse the repository at this point in the history
Fix error like

    TypeError: Return value of Sabre\HTTP\Client::curlExec() must be of
    the type string, boolean returned
  • Loading branch information
Gasol Wu committed Dec 14, 2018
1 parent 3811b56 commit ab73d45
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,12 @@ protected function curlExec($curlHandle): string
{
$this->headerLinesMap[(int) $curlHandle] = [];

return curl_exec($curlHandle);
$result = curl_exec($curlHandle);
if ($result === false) {
$result = '';
}

return $result;
}

/**
Expand Down

0 comments on commit ab73d45

Please sign in to comment.