Merge pull request #2923 from SillyTavern/fix-piping-split-unnamed-args Fix piping not actually using/inputting an array for empty unnamed args

bc05c8de157540102b285eecc3a7f310da1248c0

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
1 files changed, +8 -0Ignore whitespace
public/scripts/slash-commands/SlashCommandClosure.js+8 -0
@@ -508,6 +508,14 @@ export class SlashCommandClosure {
508508 return v;
509509 });
510510 }
511+
512+ value ??= '';
513+
514+ // Make sure that if unnamed args are split, it should always return an array
515+ if (executor.command.splitUnnamedArgument && !Array.isArray(value)) {
516+ value = [value];
517+ }
518+
511519 return value;
512520 }
513521