fix(nats-js-kv): Fix panic

Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
jkoberg
2024-07-23 09:52:37 +02:00
parent de98cca897
commit f92c6ae511
5 changed files with 14 additions and 5 deletions
+4
View File
@@ -341,6 +341,10 @@ func (n *natsStore) WatchAll(bucket string, opts ...nats.WatchOpt) (nats.KeyWatc
return nil, errors.New("multi bucket watching is not supported")
}
if err := n.initConn(); err != nil {
return nil, err
}
b, err := n.js.KeyValue(bucket)
if err != nil {
return nil, errors.Wrap(err, "Failed to get bucket")