fixup nil pointer assign
Some checks failed
codeql / analyze (go) (push) Failing after 41s
build / test (push) Failing after 4m52s
build / lint (push) Successful in 9m29s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2024-10-08 16:52:26 +03:00
parent 7c641fa8ac
commit 27eccc1ed2

View File

@ -625,12 +625,12 @@ func NewStore(opts ...store.Option) *Store {
}
func (r *Store) configure() error {
universalOptions := &goredis.UniversalOptions{}
if r.cli != nil && r.opts.Context == nil {
return nil
}
universalOptions := DefaultUniversalOptions
if r.opts.Context != nil {
if o, ok := r.opts.Context.Value(configKey{}).(*goredis.Options); ok {
universalOptions.Addrs = []string{o.Addr}
@ -704,10 +704,6 @@ func (r *Store) configure() error {
}
}
if universalOptions == nil {
universalOptions = DefaultUniversalOptions
}
if len(r.opts.Addrs) > 0 {
universalOptions.Addrs = r.opts.Addrs
} else {