diff participant.py @ 145:ddc87b605019

minor fix in Participant.changeNickname() Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Sun, 17 Jan 2010 17:42:36 +0100
parents 9f39cead20cb
children e0eea72ea493
line wrap: on
line diff
--- a/participant.py
+++ b/participant.py
@@ -182,6 +182,7 @@ class Participant:
 	def changeNickname(self, newnick, on_protocol):
 		"""Change participant's nickname."""
 		
+		p = None
 		oldnick = self.nickname
 		
 		if self.protocol == 'xmpp':
@@ -242,6 +243,10 @@ class Participant:
 		
 		self.nickname = newnick
 		self.duplicate_nickname = newnick
+		
+		if not isinstance(p, Participant):
+			return
+		
 		if p.nickname == newnick:
 			if p.protocol == self.protocol:
 				# should never happen