Skip to content

Commit

Permalink
Subscriptions: Fix panic on nil Pairs on Matchable keys
Browse files Browse the repository at this point in the history
  • Loading branch information
gbjk committed Feb 8, 2024
1 parent 18edb4f commit 214655b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion exchanges/subscription/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (k Key) Match(m Map) *Subscription {
if k.Asset != candidate.Asset {
continue
}
if len(*k.Pairs) == 0 && len(*candidate.Pairs) == 0 {
if (k.Pairs == nil || len(*k.Pairs) == 0) && (candidate.Pairs == nil || len(*candidate.Pairs) == 0) {
return v
}
if err := candidate.Pairs.ContainsAll(*k.Pairs, true); err == nil {
Expand Down

0 comments on commit 214655b

Please sign in to comment.