From d4b66ecacfd471377109cac65fa78046d74152fe Mon Sep 17 00:00:00 2001 From: Patrick Dawkins Date: Thu, 9 Jul 2026 12:52:25 +0100 Subject: [PATCH] fix(variable:get): avoid TypeError when selecting a variable interactively When run without a name argument, the command lets the user pick a variable interactively. In that case the `name` argument is null, but it was still passed to OsUtil::escapeShellArg() when printing the "To update the variable" hint, which requires a string and threw a fatal TypeError after the variable had already been displayed. Use the selected variable's own name instead, which is populated in all code paths. Co-Authored-By: Claude Opus 4.8 (1M context) --- legacy/src/Command/Variable/VariableGetCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/legacy/src/Command/Variable/VariableGetCommand.php b/legacy/src/Command/Variable/VariableGetCommand.php index 2fecfc88d..137ac4578 100644 --- a/legacy/src/Command/Variable/VariableGetCommand.php +++ b/legacy/src/Command/Variable/VariableGetCommand.php @@ -131,7 +131,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->stdErr->writeln(sprintf( 'To update the variable, use: %s variable:update %s', $executable, - OsUtil::escapeShellArg($name), + OsUtil::escapeShellArg($variable->name), )); }