Skip to content

Commit

Permalink
Fix empty response error for blank lines (#274)
Browse files Browse the repository at this point in the history
* Fix empty response error for blank lines

* better checking against false
  • Loading branch information
bierpub committed Oct 17, 2022
1 parent 68eaf30 commit 0ddfbdd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Connection/Protocols/ImapProtocol.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function nextLine(): string {
while (($next_char = fread($this->stream, 1)) !== false && $next_char !== "\n") {
$line .= $next_char;
}
if ($line === "") {
if ($line === "" && $next_char === false) {
throw new RuntimeException('empty response');
}
if ($this->debug) echo "<< ".$line."\n";
Expand Down

0 comments on commit 0ddfbdd

Please sign in to comment.