#39 Fail to parse tcx files with laps without altitude

closed-invalid
jede28
5
2012-07-26
2012-07-24
No

Fails on TCX files straight from Garmin Forerunner 410 (using garmin-ant-downloader)
I then opened the file in emacs, formatted the XML, and removed the first lap, saved, opened the file from SportsTracker and everything worked perfectly.
The first lap was useless anyway because it was before I got on the water (rowing).

I then did the opposite, left in only the first lap to get a minimal file that demonstrates the error.

The code involved seems to be a NullPointerException in GarminTcxParser.groovy:

for (evLap in exercise.lapList) {
exercise.altitude.ascent += evLap.altitude.ascent
}

Which makes sense because it involves a track that has no altitude listing (probably before the GPS got a fix):

It should be possible to just continue in the loop if exercise.altitude is null.

Stacktrace:
Caused by: java.lang.NullPointerException: Cannot get property 'ascent' on null object
at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:56)
at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:156)
at org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:44)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:227)
at de.saring.exerciseviewer.parser.impl.GarminTcxParser.calculateAvgAltitude(GarminTcxParser.groovy:306)
at de.saring.exerciseviewer.parser.impl.GarminTcxParser$calculateAvgAltitude.callCurrent(Unknown Source)
at de.saring.exerciseviewer.parser.impl.GarminTcxParser.parseExercisePath(GarminTcxParser.groovy:199)
at de.saring.exerciseviewer.parser.impl.GarminTcxParser.this$3$parseExercisePath(GarminTcxParser.groovy)
at de.saring.exerciseviewer.parser.impl.GarminTcxParser$this$3$parseExercisePath.callCurrent(Unknown Source)
at de.saring.exerciseviewer.parser.impl.GarminTcxParser.parseExercise(GarminTcxParser.groovy:39)

Discussion

  • minimal tcx file, provoking the error.

     
    Attachments
  • jede28
    jede28
    2012-07-26

    • labels: 721199 --> PolarViewer
    • assigned_to: nobody --> jede28
    • status: open --> open-accepted
     
  • jede28
    jede28
    2012-07-26

    I'm not able to reproduce this bug. I can open the attached test file perfectly with SportsTracker 5.5.0. Which version do you use?
    Please test it again with the new version and the file you have attached.
    I'll close this bug for now. If it still fails, please reopen it and attach a not working file and further details.

    Bye, Stefan

     
  • jede28
    jede28
    2012-07-26

    • status: open-accepted --> closed-invalid