Fix crash on unknown channel when applying reaction roles

This commit is contained in:
Miikka 2019-06-11 10:24:50 +03:00 committed by GitHub
parent 0f1ee84c46
commit 8af4598b99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -121,6 +121,7 @@ export class ReactionRolesPlugin extends ZeppelinPlugin<IReactionRolesPluginConf
*/
async applyReactionRoleReactionsToMessage(channelId: string, messageId: string, reactionRoles: ReactionRole[]) {
const channel = this.guild.channels.get(channelId) as TextChannel;
if (!channel) return;
let targetMessage;
try {