We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 88642c6 + ac180a1 commit be7c3e3Copy full SHA for be7c3e3
apps/files_external/lib/Lib/Storage/AmazonS3.php
@@ -163,7 +163,13 @@ private function doesDirectoryExist($path) {
163
'MaxKeys' => 1,
164
'Delimiter' => '/',
165
]);
166
- $this->directoryCache[$path] = ($result['Contents'][0]['Key'] === rtrim($path, '/') . '/') || $result['CommonPrefixes'];
+
167
+ if ((isset($result['Contents'][0]['Key']) && $result['Contents'][0]['Key'] === rtrim($path, '/') . '/')
168
+ || isset($result['CommonPrefixes'])) {
169
+ $this->directoryCache[$path] = true;
170
+ } else {
171
+ $this->directoryCache[$path] = false;
172
+ }
173
} catch (S3Exception $e) {
174
if ($e->getStatusCode() === 403) {
175
$this->directoryCache[$path] = false;
0 commit comments