Skip to content

Commit

Permalink
Update js.go
Browse files Browse the repository at this point in the history
fix nil pointer dereference when jsi is not inited
  • Loading branch information
Sergey-Belyakov committed Aug 1, 2022
1 parent 87bbea8 commit add6c39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js.go
Expand Up @@ -2466,7 +2466,7 @@ func ConsumerReplicas(replicas int) SubOpt {
func (sub *Subscription) ConsumerInfo() (*ConsumerInfo, error) {
sub.mu.Lock()
// TODO(dlc) - Better way to mark especially if we attach.
if sub.jsi.consumer == _EMPTY_ {
if sub.jsi == nil || sub.jsi.consumer == _EMPTY_ {
sub.mu.Unlock()
return nil, ErrTypeSubscription
}
Expand Down

0 comments on commit add6c39

Please sign in to comment.