From 50cba9622cbcc56e414c3c0505179d223639c7c3 Mon Sep 17 00:00:00 2001 From: LenAnderson Date: Wed, 24 Jul 2024 21:00:58 -0400 Subject: [PATCH] check that debugController exists --- public/scripts/slash-commands/SlashCommandClosure.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/scripts/slash-commands/SlashCommandClosure.js b/public/scripts/slash-commands/SlashCommandClosure.js index 55479bfc4..deec02e06 100644 --- a/public/scripts/slash-commands/SlashCommandClosure.js +++ b/public/scripts/slash-commands/SlashCommandClosure.js @@ -275,9 +275,11 @@ export class SlashCommandClosure { let isFirst = true; for (const executor of this.executorList) { this.onProgress?.(done, this.commandCount); - this.debugController?.setExecutor(executor); - this.debugController.namedArguments = undefined; - this.debugController.unnamedArguments = undefined; + if (this.debugController) { + this.debugController.setExecutor(executor); + this.debugController.namedArguments = undefined; + this.debugController.unnamedArguments = undefined; + } // yield before doing anything with this executor, the debugger might want to do // something with it (e.g., breakpoint, immediate closures that need resolving // or stepping into)