From 731c8f691fb015f8fd8e61022580a074d48a93c1 Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Thu, 21 May 2009 21:12:11 +0200
Subject: [PATCH] prevent traceback when receiving a disco info while we are
 disconnected. Fixes #5042

---
 src/common/connection_handlers.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py
index 88ae12409e..ed4c01c3b8 100644
--- a/src/common/connection_handlers.py
+++ b/src/common/connection_handlers.py
@@ -829,6 +829,8 @@ class ConnectionDisco:
 
 	def _DiscoverInfoCB(self, con, iq_obj):
 		log.debug('DiscoverInfoCB')
+		if not self.connection or self.connected < 2:
+			return
 		# According to XEP-0030:
 		# For identity: category, type is mandatory, name is optional.
 		# For feature: var is mandatory
-- 
GitLab