From 971a5a0b70e7535ab970198e5d7d47b11877ac32 Mon Sep 17 00:00:00 2001 From: Theodore Kruczek Date: Thu, 4 Apr 2024 09:20:14 -0400 Subject: [PATCH] fix: :bug: fix bug where missing intlDes data returns NaN --- src/coordinate/Tle.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/coordinate/Tle.ts b/src/coordinate/Tle.ts index e6fe5ff..938579f 100644 --- a/src/coordinate/Tle.ts +++ b/src/coordinate/Tle.ts @@ -564,6 +564,12 @@ export class Tle { */ static intlDes(tleLine1: TleLine1): string { const year2 = this.intlDesYear(tleLine1); + + // Some TLEs don't have a year, so we can't generate an IntlDes + if (isNaN(year2)) { + return ''; + } + const year4 = year2 < 57 ? year2 + 2000 : year2 + 1900; const launchNum = this.intlDesLaunchNum(tleLine1); const launchPiece = this.intlDesLaunchPiece(tleLine1);