diff --git a/storage/local/series.go b/storage/local/series.go index e1cc69947..39f648c26 100644 --- a/storage/local/series.go +++ b/storage/local/series.go @@ -60,11 +60,14 @@ func (sm *seriesMap) get(fp clientmodel.Fingerprint) (s *memorySeries, ok bool) return } -// put adds a mapping to the seriesMap. +// put adds a mapping to the seriesMap. It panics if s == nil. func (sm *seriesMap) put(fp clientmodel.Fingerprint, s *memorySeries) { sm.mtx.Lock() defer sm.mtx.Unlock() + if s == nil { + panic("tried to add nil pointer to seriesMap") + } sm.m[fp] = s }