From a73cc2bdd45dd3629ed714b3c3e4aea4df3c0054 Mon Sep 17 00:00:00 2001 From: Isaac Date: Thu, 9 Feb 2023 16:52:29 +0000 Subject: [PATCH] fix: don't close tickets twice --- src/listeners/client/channelDelete.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/listeners/client/channelDelete.js b/src/listeners/client/channelDelete.js index b371997..f8c20ce 100644 --- a/src/listeners/client/channelDelete.js +++ b/src/listeners/client/channelDelete.js @@ -18,7 +18,7 @@ module.exports = class extends Listener { where: { id: channel.id }, }); - if (!ticket?.open) return; + if (!ticket || ticket.open) return; await client.tickets.finallyClose(ticket.id, { reason: 'channel deleted' }); this.client.log.info(`Closed ticket ${ticket.id} because the channel was deleted`);