From adca289fdcf8c883800aafa545bc263452290bae Mon Sep 17 00:00:00 2001 From: alsm Date: Thu, 18 Apr 2019 15:24:49 +0100 Subject: [PATCH] Check that packets still exist when we resume 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 --- client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client.go b/client.go index f27216f7..24d56c1f 100644 --- a/client.go +++ b/client.go @@ -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) {