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 authored and staabm committed Mar 18, 2019
1 parent d9a1ee7 commit 544c67e
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 (false === $result) {
$result = '';
}

return $result;
}

/**
Expand Down

0 comments on commit 544c67e

Please sign in to comment.