fixup nil pointer assign

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 f06b1fdb15

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 {