From 554194d95491159f725fad62fbf225bccd9d7846 Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Thu, 13 Dec 2007 20:44:30 +0000
Subject: [PATCH] fix traceback when we get an error from pep service. see
 #3053

---
 src/common/connection_handlers.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py
index aba857c3e9..b48dc21546 100644
--- a/src/common/connection_handlers.py
+++ b/src/common/connection_handlers.py
@@ -1122,11 +1122,12 @@ class ConnectionVcard:
 			conf = iq_obj.getTag('pubsub').getTag('configure')
 			node = conf.getAttr('node')
 			form_tag = conf.getTag('x', namespace=common.xmpp.NS_DATA)
-			form = common.dataforms.ExtendForm(node=form_tag)
-			for field in form.iter_fields():
-				if field.var == 'pubsub#access_model':
-					self.dispatch('PEP_ACCESS_MODEL', (node, field.value))
-					break
+			if form_tag:
+				form = common.dataforms.ExtendForm(node=form_tag)
+				for field in form.iter_fields():
+					if field.var == 'pubsub#access_model':
+						self.dispatch('PEP_ACCESS_MODEL', (node, field.value))
+						break
 
 		del self.awaiting_answers[id]
 
-- 
GitLab