Fix nil dereference in cloudflare store (#1504)
This commit is contained in:
parent
8400aba81c
commit
77f5cc5023
@ -112,6 +112,9 @@ func (w *workersKV) Init(opts ...store.Option) error {
|
|||||||
if len(w.options.Database) > 0 {
|
if len(w.options.Database) > 0 {
|
||||||
w.namespace = w.options.Database
|
w.namespace = w.options.Database
|
||||||
}
|
}
|
||||||
|
if w.options.Context == nil {
|
||||||
|
w.options.Context = context.TODO()
|
||||||
|
}
|
||||||
ttl := w.options.Context.Value("STORE_CACHE_TTL")
|
ttl := w.options.Context.Value("STORE_CACHE_TTL")
|
||||||
if ttl != nil {
|
if ttl != nil {
|
||||||
ttlduration, ok := ttl.(time.Duration)
|
ttlduration, ok := ttl.(time.Duration)
|
||||||
|
Loading…
Reference in New Issue
Block a user