diff --git a/cli.php b/cli.php index 4716e131..dfb9fec3 100755 --- a/cli.php +++ b/cli.php @@ -92,7 +92,7 @@ function logError(string $message, int $exit_code = 1): void $promptInput = $positional_args[0]; if (str_starts_with($promptInput, '{') || str_starts_with($promptInput, '[')) { $decodedInput = json_decode($promptInput, true); - if ($decodedInput) { + if (json_last_error() === JSON_ERROR_NONE) { $promptInput = $decodedInput; } }