Skip to content

Commit

Permalink
optional chaining on err response object
Browse files Browse the repository at this point in the history
Co-authored-by: Rico Kahler <[email protected]>
  • Loading branch information
svirs and ricokahler committed Aug 20, 2024
1 parent f4eef22 commit 3d2f3fe
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ export function RequestAccessScreen() {
if (request) setHasPendingRequest(true)
})
.catch((err) => {
const statusCode = err && err.response && err.response.statusCode
const errMessage = err && err.response && err.response.body && err.response.body.message
const statusCode = err?.response?.statusCode
const errMessage = err?.response?.body?.message
if (statusCode === 429) {
// User is over their cross-project request limit
setHasTooManyRequests(true)
Expand Down

0 comments on commit 3d2f3fe

Please sign in to comment.