Skip to content

Commit

Permalink
fix: 🐛 fix bug where missing intlDes data returns NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
thkruz committed Apr 4, 2024
1 parent 01caccb commit 971a5a0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/coordinate/Tle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 971a5a0

Please sign in to comment.