Skip to content

Commit

Permalink
Added some protection to get rid of a null in the return array for li…
Browse files Browse the repository at this point in the history
…stobjects.
  • Loading branch information
bitcomposer committed Jul 13, 2021
1 parent 3d81b90 commit 173a79c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bitcomposer/moleculer-aws-s3",
"version": "0.1.2",
"version": "0.1.3",
"description": "An aws s3 sdk wrapper as a service for the moleculer framework",
"main": "index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ module.exports = {
const res = await this.client.send(new ListObjectsCommand(params))
params.Marker = res?.NextMarker
truncated = res?.IsTruncated
objectList = objectList.concat(res.Contents)
objectList = objectList.concat(res.Contents ?? [])
} while (truncated)

return objectList
Expand Down Expand Up @@ -220,7 +220,7 @@ module.exports = {
do {
const res = await this.client.send(new ListObjectsV2Command(params))
params.ContinuationToken = res?.NextContinuationToken
objectList = objectList.concat(res?.Contents)
objectList = objectList.concat(res?.Contents ?? [])
} while (params.ContinuationToken !== undefined)

return objectList
Expand Down

0 comments on commit 173a79c

Please sign in to comment.