Skip to content

Commit

Permalink
Fix unhandled exception in helix for loading channels that doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
BOLL7708 committed Jun 28, 2022
1 parent 8cac904 commit c3e9f1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/twitch_helix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class TwitchHelix {
const response: ITwitchHelixUsersResponse = await (
await fetch(url, {headers: this.getAuthHeaders()})
)?.json()
const result: ITwitchHelixUsersResponseData|undefined = response?.data.pop()
const result: ITwitchHelixUsersResponseData|undefined = response?.data?.pop()
if(result) {
const id = parseInt(result.id)
if(id != NaN) {
Expand Down

0 comments on commit c3e9f1f

Please sign in to comment.