summaryrefslogtreecommitdiff
path: root/strava/sync.go
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-08-11 14:19:01 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-08-11 14:19:01 +0200
commit7d13374eec8c33c4e14cc5b0c3de36e4f620ce0e (patch)
tree98a20ee73f34863ddb5938aa5eb29346e4a5db56 /strava/sync.go
parent1da94931188c35c06dd032aadce2799fc13db1dd (diff)
fix: Continue Strava import after invalid activities
Diffstat (limited to 'strava/sync.go')
-rw-r--r--strava/sync.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/strava/sync.go b/strava/sync.go
index 762b41a..45b13d3 100644
--- a/strava/sync.go
+++ b/strava/sync.go
@@ -1,6 +1,7 @@
package strava
import (
+ "errors"
"fmt"
"net/url"
"strconv"
@@ -137,6 +138,9 @@ func (c *Client) activityStreams(id int64) (activityStreams, error) {
}
func activityGPX(activity Activity, streams activityStreams) ([]byte, error) {
+ if len(streams.LatLng) == 0 {
+ return nil, errors.New("activity has no track points")
+ }
points := make([]gpx.GPXPoint, len(streams.LatLng))
for i := range streams.LatLng {
point := gpx.GPXPoint{}