summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files_external/lib/amazons3.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php
index acf976e8fe4..763cf59aa4c 100644
--- a/apps/files_external/lib/amazons3.php
+++ b/apps/files_external/lib/amazons3.php
@@ -274,6 +274,10 @@ class AmazonS3 extends \OC\Files\Storage\Common {
), array('return_prefixes' => true));
foreach ($result as $object) {
+ if (isset($object['Key']) && $object['Key'] === $path) {
+ // it's the directory itself, skip
+ continue;
+ }
$file = basename(
isset($object['Key']) ? $object['Key'] : $object['Prefix']
);