From 28b32af063f5dde76b601c185a0cc44d791d6be2 Mon Sep 17 00:00:00 2001 From: Mitch Talmadge Date: Tue, 30 Mar 2021 14:04:59 -0600 Subject: [PATCH] Only send welcome message if channel exists. --- src/controllers/channel/course-selection.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/channel/course-selection.ts b/src/controllers/channel/course-selection.ts index 9e47bdd..6b065dd 100644 --- a/src/controllers/channel/course-selection.ts +++ b/src/controllers/channel/course-selection.ts @@ -29,7 +29,7 @@ export class CourseSelectionChannelController extends ChannelController { .then(implement => { if (implement) { const courseChannel = this.guildContext.guild.channels.resolve(implement.channelIds[CourseImplementChannelType.CHAT]) as Discord.TextChannel; - courseChannel.send(`Welcome, ${message.author}!`); + courseChannel?.send(`Welcome, ${message.author}!`); } }) .catch(err => {