From 17b758986d0a999a0c39859ab6a7637529649be8 Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Mon, 12 Jul 2021 22:20:01 +0200 Subject: [PATCH] Fix deprecation warning on PHP 8.1 --- src/Driver/ParallelFile.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Driver/ParallelFile.php b/src/Driver/ParallelFile.php index 67e1278..035d16a 100644 --- a/src/Driver/ParallelFile.php +++ b/src/Driver/ParallelFile.php @@ -141,7 +141,10 @@ final class ParallelFile implements File try { $data = yield $this->worker->enqueue(new Internal\FileTask('fread', [$length], $this->id)); - $this->position += \strlen($data); + + if ($data !== null) { + $this->position += \strlen($data); + } } catch (TaskException $exception) { throw new StreamException("Reading from the file failed", 0, $exception); } catch (WorkerException $exception) {