diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py
index 361b4e9e5de077a6adb73ec27183d28e7b15b6bc..5c61fe74748fc78c0f62144c9f133a358b439e16 100644
--- a/src/common/connection_handlers.py
+++ b/src/common/connection_handlers.py
@@ -1494,6 +1494,8 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
 		raise common.xmpp.NodeProcessed
 
 	def _LastCB(self, con, iq_obj):
+		if not self.connection:
+			return
 		gajim.log.debug('LastCB')
 		iq_obj = iq_obj.buildReply('result')
 		qp = iq_obj.getTag('query')