Package gfit: Check return value of readCumulative() for errors.
authorFlorian Forster <ff@octo.it>
Mon, 22 Jan 2018 21:12:48 +0000 (22:12 +0100)
committerFlorian Forster <ff@octo.it>
Mon, 22 Jan 2018 21:14:09 +0000 (22:14 +0100)
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" {