Skip to content

Commit

Permalink
Bugfix for reading from empty buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
cracksalad committed Nov 20, 2023
1 parent 8f65b46 commit ed556a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/LargeArrayBuffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function rewind(): void {
* @throws \RuntimeException if unable to read from php://temp
*/
public function next(): void {
if(feof($this->stream)) {
if(feof($this->stream) || $this->count === 0) { // stream is not initialized before first write
$this->current = null;
return;
}
Expand Down

0 comments on commit ed556a8

Please sign in to comment.