From 1eb72f6bf8ce5edc969afbb5f6168eb93bfd52f7 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Tue, 1 Jul 2025 12:01:49 +0100 Subject: [PATCH] fixes regression with audio mute add guard clauses to audio toggle/status in case audioName wasn't given --- index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index a18a4df..15ac0cc 100755 --- a/index.js +++ b/index.js @@ -98,7 +98,7 @@ socket.onopen = function () { withChannel(socket, (channel) => audioList(channel, flags.id)) break case 'mute': - if (!audioName) { + if (!audioArguments[0]) { console.error('Error: Audio name is required for the mute command.') process.exit(1) } @@ -112,9 +112,17 @@ socket.onopen = function () { withChannel(socket, (channel) => audioUnmute(channel, audioArguments[0])) break case 'toggle': + if (!audioArguments[0]) { + console.error('Error: Audio name is required for the toggle command.') + process.exit(1) + } withChannel(socket, (channel) => audioToggle(channel, audioArguments[0])) break case 'status': + if (!audioArguments[0]) { + console.error('Error: Audio name is required for the status command.') + process.exit(1) + } withChannel(socket, (channel) => audioStatus(channel, audioArguments[0])) break default: