Skip to content

Commit 8fa3a89

Browse files
authored
fix(Action): Don't crash when partials are disabled (#4822)
1 parent 9c76129 commit 8fa3a89

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/client/actions/Action.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ class GenericAction {
9393
if (data.guild_id) {
9494
const guild = this.client.guilds.cache.get(data.guild_id);
9595
if (guild) {
96-
return this.getMember(data.member, guild).user;
96+
const member = this.getMember(data.member, guild);
97+
return member ? member.user : undefined;
9798
}
9899
}
99100
return this.getUser(data);

src/client/actions/TypingStart.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ const textBasedChannelTypes = ['dm', 'text', 'news'];
77
class TypingStart extends Action {
88
handle(data) {
99
const channel = this.getChannel(data);
10+
if (!channel) {
11+
return;
12+
}
1013
if (!textBasedChannelTypes.includes(channel.type)) {
1114
this.client.emit(Events.WARN, `Discord sent a typing packet to a ${channel.type} channel ${channel.id}`);
1215
return;

0 commit comments

Comments
 (0)