Fix nil pointer dereference (#1289)
This commit is contained in:
parent
eebd69c995
commit
beb5e80e87
@ -231,7 +231,9 @@ func (w *workersKV) Read(key string, opts ...store.ReadOption) ([]*store.Record,
|
||||
}
|
||||
record.Expiry = time.Until(time.Unix(expiryUnix, 0))
|
||||
}
|
||||
w.cache.Set(record.Key, record, cache.DefaultExpiration)
|
||||
if w.cache != nil {
|
||||
w.cache.Set(record.Key, record, cache.DefaultExpiration)
|
||||
}
|
||||
records = append(records, record)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user