diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_external/lib/Lib/Storage/AmazonS3.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php index cc9cdc08138..cf79e05c9c3 100644 --- a/apps/files_external/lib/Lib/Storage/AmazonS3.php +++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php @@ -292,15 +292,17 @@ class AmazonS3 extends \OC\Files\Storage\Common { $files[] = substr(trim($prefix['Prefix'], '/'), strlen($path)); } } - foreach ($result['Contents'] as $object) { - if (isset($object['Key']) && $object['Key'] === $path) { - // it's the directory itself, skip - continue; + if (is_array($result['Contents'])) { + foreach ($result['Contents'] 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'] + ); + $files[] = $file; } - $file = basename( - isset($object['Key']) ? $object['Key'] : $object['Prefix'] - ); - $files[] = $file; } } |