From 110079d99dc6e069f13885e1a1160d44a8a8b368 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 21 Jan 2026 05:05:02 +0000 Subject: [PATCH] fix: guard nodes status duration parsing (#1354) (thanks @vignesh07) --- src/cli/nodes-cli/register.status.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cli/nodes-cli/register.status.ts b/src/cli/nodes-cli/register.status.ts index 4f8e2ae76..3c89cc0fc 100644 --- a/src/cli/nodes-cli/register.status.ts +++ b/src/cli/nodes-cli/register.status.ts @@ -46,7 +46,13 @@ function formatNodeVersions(node: { function parseSinceMs(raw: unknown, label: string): number | undefined { if (raw === undefined || raw === null) return undefined; - const value = String(raw).trim(); + const value = + typeof raw === "string" ? raw.trim() : typeof raw === "number" ? String(raw).trim() : null; + if (value === null) { + defaultRuntime.error(`${label}: invalid duration value`); + defaultRuntime.exit(1); + return undefined; + } if (!value) return undefined; try { return parseDurationMs(value);