Skip to content

Commit bd8197d

Browse files
authored
Merge pull request #62 from cloudgraphdev/fix/CG-1194-v3
fix: Added missing return to resolve promise
2 parents efe7eaa + 904b25d commit bd8197d

4 files changed

Lines changed: 11 additions & 7 deletions

File tree

src/services/apiGatewayRestApi/data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ const getAPIMappings = (
113113
* No Data for the region
114114
*/
115115
if (isEmpty(data)) {
116-
resolveBasePathMapping({
116+
return resolveBasePathMapping({
117117
domainName,
118118
restApiData: [],
119119
})

src/services/cloudfront/data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const listCloudfrontDistributions = async (
6868
* No Distributions Found
6969
*/
7070
if (isEmpty(Items)) {
71-
resolve([])
71+
return resolve([])
7272
}
7373

7474
distributions.push(...Items)

src/services/elasticBeanstalkApplication/data.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ const listApplications = async (
4141
* No EB Applications for this region
4242
*/
4343
if (isEmpty(data)) {
44-
resolve([])
44+
return resolve([])
4545
}
4646
const { Applications = [] } = data || {}
4747
if (isEmpty(Applications)) {
48-
resolve([])
48+
return resolve([])
4949
}
5050
resolve(Applications)
5151
}
@@ -72,11 +72,11 @@ export const getResourceTags = async (
7272
* No EB Applications for this region
7373
*/
7474
if (isEmpty(data)) {
75-
resolveTags({})
75+
return resolveTags({})
7676
}
7777
const { ResourceTags: tags } = data || {}
7878
if (isEmpty(tags)) {
79-
resolveTags({})
79+
return resolveTags({})
8080
}
8181
resolveTags(convertAwsTagsToTagMap(tags as AwsTag[]))
8282
}

src/services/sns/data.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,15 @@ const getTopicSubscriptions = async (
171171
}
172172

173173
if (isEmpty(data)) {
174-
resolveSubscriptions([])
174+
return resolveSubscriptions([])
175175
}
176176

177177
const { Subscriptions, NextToken } = data || {}
178178

179+
if (isEmpty(Subscriptions)) {
180+
return resolveSubscriptions([])
181+
}
182+
179183
subscriptions.push(...Subscriptions)
180184

181185
if (NextToken) {

0 commit comments

Comments
 (0)