check for NaN

This commit is contained in:
Grant Limberg
2023-09-13 18:08:52 -07:00
parent a646d2cd49
commit 6daec15995
+1 -1
View File
@@ -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;