Skip to content

Commit

Permalink
Optional chain userBody
Browse files Browse the repository at this point in the history
There's a chance it might be undefined so isBanned won't exist
  • Loading branch information
Regalijan authored Dec 13, 2024
1 parent 86800d5 commit 6765b75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/users/getPlayerInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function getPlayerInfo (userId) {
const userBody = responses[0]
const failedResponses = promiseResponses.filter(presponse => presponse.status === 'rejected')

if (userBody.isBanned) {
if (userBody?.isBanned) {
const joinDate = new Date(userBody.created)
const blurb = userBody.description
const isBanned = userBody.isBanned
Expand Down

0 comments on commit 6765b75

Please sign in to comment.