From: Florian Forster Date: Mon, 22 Jan 2018 21:12:48 +0000 (+0100) Subject: Package gfit: Check return value of readCumulative() for errors. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=95db19974a6809fc619b70146b6ec3372938412a;p=kraftakt.git Package gfit: Check return value of readCumulative() for errors. --- diff --git a/gfit/gfit.go b/gfit/gfit.go index 581a9fe..8f3fbac 100644 --- a/gfit/gfit.go +++ b/gfit/gfit.go @@ -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" {