Comment 0 for bug 316540

Revision history for this message
Jeremy Thurgood (jerith) wrote : Bad handling of unregistered nicks in NickServ

It looks like we assume we'll get a Nick object back from getUser(), but in the case of an unregistered nick we don't. We need to either have an appropriate object for unregistered nicks or deal with the Nones appropriately.

2009-01-12 23:32:38+0200 [InspircdServices,client] Unhandled Error
 Traceback (most recent call last):
   File "/usr/lib/python2.4/site-packages/Axiom-0.5.30-py2.4.egg/axiom/store.py", line 1640, in transact
     result = f(*a, **k)
   File "/home/jerith/python/kali/branches/nickserv-register/kali/protocol.py", line 159, in handle
     method(prefix, *params)
   File "/home/jerith/python/kali/branches/nickserv-register/kali/protocol.py", line 248, in irc_NICK
     self.services.event('nickchange', oldnick, newnick)
   File "/home/jerith/python/kali/branches/nickserv-register/kali/controller.py", line 336, in event
     self.sendEvent(p, event, *params)
 --- <exception caught here> ---
   File "/home/jerith/python/kali/branches/nickserv-register/kali/controller.py", line 347, in sendEvent
     method(*params)
   File "/home/jerith/python/kali/branches/nickserv-register/kali/nickserv.py", line 191, in event_nickchange
     self.logout(old)
   File "/home/jerith/python/kali/branches/nickserv-register/kali/nickserv.py", line 159, in logout
     self.ctrl.getUser(nick).registered = False
 exceptions.AttributeError: 'NoneType' object has no attribute 'registered'