Blank track segments cause exception on statistics generation

Bug #701603 reported by Andrew Gee
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
GPX Viewer
Fix Released
Medium
Andrew Gee

Bug Description

If a GPX trace has an empty trkseg tag <trkseg></trkseg>, the application will fail to fully import the gpx trace file, and will throw an exception:

Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/gpxviewer/ui.py", line 300, in onTrackAdded
    self.selectTrace(trace)
  File "/usr/local/lib/python2.6/dist-packages/gpxviewer/ui.py", line 347, in selectTrace
    distance = trace.get_distance()
  File "/usr/local/lib/python2.6/dist-packages/gpxviewer/gpx.py", line 151, in get_distance
    return self._get_cached_value("distance")
  File "/usr/local/lib/python2.6/dist-packages/gpxviewer/gpx.py", line 97, in _get_cached_value
    self._walk_points()
  File "/usr/local/lib/python2.6/dist-packages/gpxviewer/gpx.py", line 85, in _walk_points
    seconds += (pointp['time'] - segment['points'][0]['time']).seconds
TypeError: 'NoneType' object is unsubscriptable

Revision history for this message
Andrew Gee (andrewgee) wrote :

Fix completed by not importing blank trksegs into the gpx trace object.

Changed in gpxviewer:
assignee: nobody → Andrew Gee (andrewgee)
importance: Undecided → Medium
status: New → Fix Committed
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.