From ca5a489d2c24492dcaf0d55e38d7c618418a5577 Mon Sep 17 00:00:00 2001 From: TheKysek Date: Wed, 12 Jul 2017 08:31:08 +0200 Subject: [PATCH] Do not crash when receiving an object we no longer need --- minode/connection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/minode/connection.py b/minode/connection.py index cd6add1..1d7b72d 100644 --- a/minode/connection.py +++ b/minode/connection.py @@ -293,8 +293,8 @@ class Connection(threading.Thread): elif m.command == b'object': obj = structure.Object.from_message(m) logging.debug('{}:{} -> {}'.format(self.host_print, self.port, obj)) - del self.vectors_requested[obj.vector] - self.vectors_to_get.remove(obj.vector) + self.vectors_requested.pop(obj.vector, None) + self.vectors_to_get.discard(obj.vector) if obj.is_valid() and obj.vector not in shared.objects: with shared.objects_lock: shared.objects[obj.vector] = obj