diff --git a/src/bot.ts b/src/bot.ts
index 21e29e58b61ee5879a045d7eb9be096381d580c1..387c0b8ed545aa236cd636fcfea29c52fccaa4a2 100644
--- a/src/bot.ts
+++ b/src/bot.ts
@@ -156,8 +156,8 @@ export class DiscordBot {
 
     public unlockChannel(channel: Discord.Channel) {
         const lock = this.channelLocks[channel.id];
-        if (lock) {
-            clearTimeout(lock.i!);
+        if (lock && lock.i) {
+            clearTimeout(lock.i);
         }
         delete this.channelLocks[channel.id];
     }