Skip to content

Commit f18b6c0

Browse files
committed
Handle cases where data is undefined in requester
To prevent the following error: ``` .../node_modules/armlet/lib/requester.js:73 const msgs = data.details.reduce((acc, detail) => { ^ TypeError: Cannot read property 'details' of undefined ```
1 parent 49d65bf commit f18b6c0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/requester.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ exports.do = (input, accessToken, apiUrl) => {
6666
// then we have something useful that can be passed back untouched.
6767
reject(res.statusMessage)
6868
}
69-
} else if (!data || !data.details) {
69+
}
70+
71+
if (!data || !data.details) {
7072
reject(errMsg)
7173
return
7274
}

0 commit comments

Comments
 (0)