Commit 8993a460 authored by David Maus's avatar David Maus
Browse files

Handle case where octet buffer is empty

* src/HAB/Pica/Reader/PicaNormReader.php: Handle case where octet buffer
  is empty.
parent addd4310
...@@ -230,6 +230,9 @@ class PicaNormReader extends Reader ...@@ -230,6 +230,9 @@ class PicaNormReader extends Reader
if ($buffer === false) { if ($buffer === false) {
throw new RuntimeException('Error reading input stream'); throw new RuntimeException('Error reading input stream');
} }
if (strlen($buffer) === 0) {
return null;
}
$this->bufferPosition = 0; $this->bufferPosition = 0;
$this->bufferSize = strlen($buffer); $this->bufferSize = strlen($buffer);
$this->buffer = $buffer; $this->buffer = $buffer;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment