From eca82f8c63206f74a0679d7b3511e72bb55daac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E6=98=AF=E7=84=B6?= <38133602+ranpro@users.noreply.github.com> Date: Fri, 28 Oct 2022 11:13:49 +0800 Subject: [PATCH] fix: call function on bool value --- src/CosAdapter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CosAdapter.php b/src/CosAdapter.php index bdd1808..03d3f35 100644 --- a/src/CosAdapter.php +++ b/src/CosAdapter.php @@ -244,7 +244,7 @@ public function fileSize(string $path): FileAttributes { $meta = $this->getMetadata($path); - if ($meta->fileSize() === null) { + if (!$meta || $meta->fileSize() === null) { throw UnableToRetrieveMetadata::fileSize($path); }