Skip to content

Commit

Permalink
fix: build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-rw committed Oct 7, 2024
1 parent ac424cb commit 1d4c838
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/clients/discord/discord.voice.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ export class DiscordVoiceService implements OnModuleDestroy {
voiceChannelId,
)) as VoiceChannel | undefined;
if (voiceChannel === undefined) {
if (!this.autoLeaveIntervalId) {
this.logger.error(
'Unable to cancel interval because interval id is not defined',
);
return;
}
clearInterval(this.autoLeaveIntervalId);
return;
}
Expand All @@ -138,6 +144,10 @@ export class DiscordVoiceService implements OnModuleDestroy {

if (voiceChannelMembersExpectBots.size > 0) return;

if (!this.autoLeaveIntervalId) {
return;
}

try {
this.stop(true);
this.disconnect();
Expand Down

0 comments on commit 1d4c838

Please sign in to comment.