Skip to content

Commit e05336b

Browse files
committed
Fix lint warning
1 parent 111f1f1 commit e05336b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/command/CommandDispatcher.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ export class CommandDispatcher
214214

215215
// Set up the command lock for this command if it exists
216216
const lock: CommandLock = command!.lock;
217-
let lockTimeout: NodeJS.Timer;
217+
let lockTimeout!: NodeJS.Timer;
218218
if (!dm && lock)
219219
{
220220
Util.assignNestedValue(this._locks, [message.guild.id, command!.name], lock);
@@ -241,7 +241,10 @@ export class CommandDispatcher
241241
if (!dm && lock)
242242
{
243243
Util.removeNestedValue(this._locks, [message.guild.id, command!.name]);
244-
if (lockTimeout!) this._client.clearTimeout(lockTimeout!);
244+
245+
if (typeof lockTimeout !== 'undefined')
246+
this._client.clearTimeout(lockTimeout);
247+
245248
lock.free(message, args);
246249
}
247250

0 commit comments

Comments
 (0)