diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php index a22998e55aca..f7daa283d2fc 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/src/Composer/Util/RemoteFilesystem.php @@ -526,7 +526,7 @@ protected function getRemoteContents(string $originUrl, string $fileUrl, $contex } catch (\Throwable $e) { } - if ($maxFileSize !== null && Platform::strlen($result) >= $maxFileSize) { + if ($result !== false && $maxFileSize !== null && Platform::strlen($result) >= $maxFileSize) { throw new MaxFileSizeExceededException('Maximum allowed download size reached. Downloaded ' . Platform::strlen($result) . ' of allowed ' . $maxFileSize . ' bytes'); }