Skip to content

Commit

Permalink
return nil and clarify cause
Browse files Browse the repository at this point in the history
  • Loading branch information
kung-foo committed Aug 7, 2019
1 parent 5dae78d commit 5264f87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,10 +554,10 @@ func (c *Client) Subscribe(params *SubscriptionParameters) (*Subscription, error
}
c.subMux.Lock()
if sub.SubscriptionID == 0 || c.subscriptions[sub.SubscriptionID] != nil {
// this should not happen
// this should not happen and is usually indicative of a server bug
// see: Part 4 Section 5.13.2.2, Table 88 – CreateSubscription Service Parameters
c.subMux.Unlock()
return sub, ua.StatusBadSubscriptionIDInvalid
return nil, ua.StatusBadSubscriptionIDInvalid
}
c.subscriptions[sub.SubscriptionID] = sub
c.subMux.Unlock()
Expand Down

0 comments on commit 5264f87

Please sign in to comment.