Skip to content

Commit

Permalink
Check before using array in READY handler (abalabahaha#1025)
Browse files Browse the repository at this point in the history
  • Loading branch information
wh0 authored Mar 25, 2021
1 parent c149e73 commit daa0c8a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/gateway/Shard.js
Original file line number Diff line number Diff line change
Expand Up @@ -1850,9 +1850,11 @@ class Shard extends EventEmitter {
} else {
this.client.bot = false;
this.client.userGuildSettings = {};
packet.d.user_guild_settings.forEach((guildSettings) => {
this.client.userGuildSettings[guildSettings.guild_id] = guildSettings;
});
if(packet.d.user_guild_settings) {
packet.d.user_guild_settings.forEach((guildSettings) => {
this.client.userGuildSettings[guildSettings.guild_id] = guildSettings;
});
}
this.client.userSettings = packet.d.user_settings;
}

Expand Down

0 comments on commit daa0c8a

Please sign in to comment.