Merge pull request #1612 from weaveworks/fix-memcache-crash

Fix nil pointer error when memcache not enabled
This commit is contained in:
Jonathan Lange
2016-06-26 14:37:38 +01:00
committed by GitHub

View File

@@ -330,8 +330,12 @@ func (c *dynamoDBCollector) getReports(userid string, row int64, start, end time
return nil, err
}
stores := []ReportStore{c.inProcess}
if c.memcache != nil {
stores = append(stores, c.memcache)
}
var reports []report.Report
for _, store := range []ReportStore{c.inProcess, c.memcache} {
for _, store := range stores {
if store == nil {
continue
}