Skip to content

Commit

Permalink
Merge pull request #1024 from Sergey-Belyakov/patch-1
Browse files Browse the repository at this point in the history
ConsumerInfo fix nil pointer dereference
  • Loading branch information
derekcollison committed Aug 1, 2022
2 parents 87bbea8 + add6c39 commit fc77603
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 fc77603

Please sign in to comment.