mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
parent
9a68157b86
commit
150ee7631e
@ -175,6 +175,12 @@ class FileApiDriverAmazonS3 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
metadataToStats_(mds) {
|
metadataToStats_(mds) {
|
||||||
|
// aws-sdk-js-v3 can rerturn undefined instead of an empty array when there is
|
||||||
|
// no metadata in some cases.
|
||||||
|
//
|
||||||
|
// Thus, we handle the !mds case.
|
||||||
|
if (!mds) return [];
|
||||||
|
|
||||||
const output = [];
|
const output = [];
|
||||||
for (let i = 0; i < mds.length; i++) {
|
for (let i = 0; i < mds.length; i++) {
|
||||||
output.push(this.metadataToStat_(mds[i], mds[i].Key));
|
output.push(this.metadataToStat_(mds[i], mds[i].Key));
|
||||||
@ -212,10 +218,6 @@ class FileApiDriverAmazonS3 {
|
|||||||
|
|
||||||
let response = await this.s3ListObjects(prefixPath);
|
let response = await this.s3ListObjects(prefixPath);
|
||||||
|
|
||||||
// In aws-sdk-js-v3 if there are no contents it no longer returns
|
|
||||||
// an empty array. This creates an Empty array to pass onward.
|
|
||||||
if (response.Contents === undefined) response.Contents = [];
|
|
||||||
|
|
||||||
let output = this.metadataToStats_(response.Contents, prefixPath);
|
let output = this.metadataToStats_(response.Contents, prefixPath);
|
||||||
|
|
||||||
while (response.IsTruncated) {
|
while (response.IsTruncated) {
|
||||||
|
Loading…
Reference in New Issue
Block a user