Fix nil pointer error when memcache not enabled

This commit is contained in:
Jonathan Lange
2016-06-24 14:01:46 +01:00
parent 29133e54ca
commit 387c543a87
+5 -1
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
}