From 6daec15995e6f921c7fd3342fb7297ef0726da7f Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Wed, 13 Sep 2023 18:08:52 -0700 Subject: [PATCH] check for NaN --- typescript/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/index.ts b/typescript/index.ts index 5d369cd..6ec106c 100644 --- a/typescript/index.ts +++ b/typescript/index.ts @@ -58,7 +58,7 @@ function decode(pairs: string[], toleranceSeconds: number): signedHeader { if (item == "t") { var timestamp = parseInt(value, 10); - if (timestamp == undefined) { + if (timestamp == undefined || isNaN(timestamp)) { throw "Invalid Header"; } sh.timestamp = timestamp;