Skip to content

Commit 63e6d4a

Browse files
committed
fix: iamInstanceProfile never returning when there's a permission's error
1 parent d79a230 commit 63e6d4a

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

  • src/services/iamInstanceProfile

src/services/iamInstanceProfile/data.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,19 @@ export const listInstancesProfiles = async (
5454
})
5555
}
5656

57-
const { InstanceProfiles = [], IsTruncated, Marker } = data
57+
if (!isEmpty(data)) {
58+
const { InstanceProfiles = [], IsTruncated, Marker } = data
5859

59-
instanceProfileList.push(...InstanceProfiles)
60+
instanceProfileList.push(...InstanceProfiles)
6061

61-
if (IsTruncated) {
62-
listAllInstanceProfiles(Marker)
62+
if (IsTruncated) {
63+
listAllInstanceProfiles(Marker)
64+
}
65+
66+
resolve(instanceProfileList)
6367
}
6468

65-
resolve(instanceProfileList)
69+
resolve([])
6670
}
6771
)
6872
} catch (error) {

0 commit comments

Comments
 (0)