sports-lib icon indicating copy to clipboard operation
sports-lib copied to clipboard

Null check missing if there are no activities

Open aldipower opened this issue 3 years ago • 3 comments

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)

aldipower avatar Jul 25 '20 18:07 aldipower

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 ?

jimmykane avatar Jul 26 '20 09:07 jimmykane

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)

aldipower avatar Jul 26 '20 18:07 aldipower

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

jimmykane avatar Jul 27 '20 08:07 jimmykane