Skip to content

Commit

Permalink
forecast.io backend: fix bug where at least one day of forecast was r…
Browse files Browse the repository at this point in the history
…eturned
  • Loading branch information
schachmat committed Jun 14, 2016
1 parent 6e0b48a commit 6f7b2f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backends/forecast.io.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,10 @@ func (c *forecastConfig) Fetch(location string, numdays int) iface.Data {
if ret.Current, err = c.parseCond(resp.Currently); err != nil {
log.Fatalf("Could not parse current weather condition: %v", err)
}
ret.Forecast = c.parseDaily(resp.Hourly, resp.Daily, numdays)

if numdays >= 1 {
ret.Forecast = c.parseDaily(resp.Hourly, resp.Daily, numdays)

var tHistory, tFuture = <-todayChan, ret.Forecast[0].Slots
var tRet []iface.Cond
h, f := 0, 0
Expand Down

0 comments on commit 6f7b2f4

Please sign in to comment.