diff --git a/src/CachingStream.php b/src/CachingStream.php index 2c1d65c5..7a70ee94 100644 --- a/src/CachingStream.php +++ b/src/CachingStream.php @@ -36,7 +36,13 @@ public function __construct( public function getSize(): ?int { - return max($this->stream->getSize(), $this->remoteStream->getSize()); + $remoteSize = $this->remoteStream->getSize(); + + if (null === $remoteSize) { + return null; + } + + return max($this->stream->getSize(), $remoteSize); } public function rewind(): void