sports-alliance / sports-lib

A Library for processing GPX, TCX, FIT and JSON files from services such as Strava, Movescount, Garmin, Polar etc
GNU Affero General Public License v3.0
149 stars 21 forks source link

Null check missing if there are no activities #62

Open aldipower opened 3 years ago

aldipower commented 3 years ago

Hi! I am trying to parse some tcx-files.

If there is for some reason no "Activity" in it, then the importer.tcx.tx blows up hard, because a null-check is missing.

TypeError: Cannot read property 'startDate' of undefined at /home/felix/example_project/node_modules/@sports-alliance/sports-lib/lib/events/adapters/importers/tcx/importer.tcx.js:83:63

https://github.com/sports-alliance/sports-lib/blob/develop/src/events/adapters/importers/tcx/importer.tcx.ts#L99


How did the Garmin hackers escape? They just ransomware.

(Found in the internet)

jimmykane commented 3 years ago

Hey @aldipower thanks for this check.

And hey this joke made my day :-D

That said could you provide some TCX file so I can check why the activity is missing ?

aldipower commented 3 years ago

Hey @jimmykane !

I am a little bit of an idiot because I deleted the .tcx before I decided it is worth to write a bug report. I would also provide a PR on my own, but I am really not into TypeScript yet, although I would like. Sorry for that.

I mean, it's just only about how it fails. Without an "Activity" it fails anyway.. No high priority for me.


What's the difference between the Titanic and Garmin? The Titanic did sync.

(Found on the internet)

jimmykane commented 3 years ago

Let's keep this issue open and once we can reproduce this I ll fix.

I just released v5 that should allow also GPX export. Now you can export FIT / TCX to GPX