Package gfit: Check return value of readCumulative() for errors.
[kraftakt.git] / gfit / gfit.go
index 581a9fe..8f3fbac 100644 (file)
@@ -240,6 +240,9 @@ func (c *Client) updateCumulative(ctx context.Context, dataSource *fitness.DataS
 
        endOfDay := startOfDay.Add(24 * time.Hour).Add(-1 * time.Nanosecond)
        currValue, startTime, err := c.readCumulative(ctx, dataSource, startOfDay, endOfDay)
+       if err != nil {
+               return err
+       }
 
        var diffValue fitness.Value
        if dataSource.DataType.Field[0].Format == "integer" {