Skip to content

Commit

Permalink
Check that packets still exist when we resume
Browse files Browse the repository at this point in the history
Possible nil pointer deference, after getting all the keys still in the
store it's possible that packets will arrive that cause them to be
removed. Now check that the packet returned from the
store is not nil

resolves #291
  • Loading branch information
alsm committed Apr 18, 2019
1 parent 1c3a9d2 commit adca289
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,9 @@ func (c *client) resume(subscription bool) {
storedKeys := c.persist.All()
for _, key := range storedKeys {
packet := c.persist.Get(key)
if packet == nil {
continue
}
details := packet.Details()
if isKeyOutbound(key) {
switch packet.(type) {
Expand Down

0 comments on commit adca289

Please sign in to comment.