diff --git a/lib/EioHandle.php b/lib/EioHandle.php index 8a97cd4..ddd07ec 100644 --- a/lib/EioHandle.php +++ b/lib/EioHandle.php @@ -66,7 +66,7 @@ class EioHandle implements Handle { )); } else { $this->position += \strlen($result); - $deferred->resolve($result); + $deferred->resolve(\strlen($result) ? $result : null); } } diff --git a/test/HandleTest.php b/test/HandleTest.php index d1e259b..adf8c83 100644 --- a/test/HandleTest.php +++ b/test/HandleTest.php @@ -53,6 +53,7 @@ abstract class HandleTest extends TestCase { $this->assertSame($position, $handle->tell()); } + $this->assertNull(yield $handle->read()); $this->assertSame(yield File\get(__FILE__), $contents); yield $handle->close();