diff --git a/vendor/magento/module-aws-s3/Driver/AwsS3.php b/vendor/magento/module-aws-s3/Driver/AwsS3.php index a42b0c926399..95c62a0b17a2 100644 --- a/vendor/magento/module-aws-s3/Driver/AwsS3.php +++ b/vendor/magento/module-aws-s3/Driver/AwsS3.php @@ -252,8 +252,9 @@ public function deleteDirectory($path): bool /** * @inheritDoc + * @return bool|int */ - public function filePutContents($path, $content, $mode = null): int + public function filePutContents($path, $content, $mode = null) { $path = $this->normalizeRelativePath($path, true); $config = self::CONFIG; @@ -267,10 +268,11 @@ public function filePutContents($path, $content, $mode = null): int try { $this->adapter->write($path, $content, new Config($config)); - return $this->adapter->fileSize($path)->fileSize(); + return ($this->adapter->fileSize($path)->fileSize() !== null)??true; + } catch (\League\Flysystem\FilesystemException | UnableToRetrieveMetadata $e) { $this->logger->error($e->getMessage()); - return 0; + return false; } }