Skip to content

Commit

Permalink
Fix lint warning
Browse files Browse the repository at this point in the history
  • Loading branch information
zajrik committed Jan 8, 2021
1 parent 111f1f1 commit e05336b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/command/CommandDispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export class CommandDispatcher

// Set up the command lock for this command if it exists
const lock: CommandLock = command!.lock;
let lockTimeout: NodeJS.Timer;
let lockTimeout!: NodeJS.Timer;
if (!dm && lock)
{
Util.assignNestedValue(this._locks, [message.guild.id, command!.name], lock);
Expand All @@ -241,7 +241,10 @@ export class CommandDispatcher
if (!dm && lock)
{
Util.removeNestedValue(this._locks, [message.guild.id, command!.name]);
if (lockTimeout!) this._client.clearTimeout(lockTimeout!);

if (typeof lockTimeout !== 'undefined')
this._client.clearTimeout(lockTimeout);

lock.free(message, args);
}

Expand Down

0 comments on commit e05336b

Please sign in to comment.