aboutsummaryrefslogtreecommitdiff
path: root/fietsboek/convert.py
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2025-11-01 14:09:25 +0100
committerDaniel Schadt <kingdread@gmx.de>2025-11-01 14:09:25 +0100
commitf5b6255f19433ac6db62658f24da73f62192c810 (patch)
tree5eef4138ded58dbfb21662633446a69f0012148b /fietsboek/convert.py
parentcea67730a25376470dc34177865d09f319afcc08 (diff)
downloadfietsboek-f5b6255f19433ac6db62658f24da73f62192c810.tar.gz
fietsboek-f5b6255f19433ac6db62658f24da73f62192c810.tar.bz2
fietsboek-f5b6255f19433ac6db62658f24da73f62192c810.zip
don't choke if no GPX timestamps are set
This usually happens in synthetic tracks, which we still want to load correctly.
Diffstat (limited to 'fietsboek/convert.py')
-rw-r--r--fietsboek/convert.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/fietsboek/convert.py b/fietsboek/convert.py
index 04c7e73..7815ef4 100644
--- a/fietsboek/convert.py
+++ b/fietsboek/convert.py
@@ -78,7 +78,10 @@ def from_gpx(data: bytes) -> Track:
if start_time is None:
start_time = point.time
- time_offset = (point.time - start_time).total_seconds()
+ if point.time is not None and start_time is not None:
+ time_offset = (point.time - start_time).total_seconds()
+ else:
+ time_offset = 0
points.append(geo.Point(
longitude=point.longitude,
latitude=point.latitude,