ElementalAlchemist/txircd — pull request #7 by ekimekim (2014-08-17 09:16:07+00:00)
Title: Fix a bug where whowas tries to add a user with no nick

If a user times out on registering a nick (_timeoutRegistration),
then whoWas.addUserToWhowas gets called but user.nick is None.
This causes an exception like so:

ERROR:twisted:Unhandled Error
Traceback (most recent call last):
File "/var/env/txircd/lib/python2.7/site-packages/twisted/application/app.py", line 392, in startReactor
self.config, oldstdout, oldstderr, self.profiler, reactor)
File "/var/env/txircd/lib/python2.7/site-packages/twisted/application/app.py", line 313, in runReactorWithLogging
reactor.run()
File "/var/env/txircd/lib/python2.7/site-packages/twisted/internet/base.py", line 1192, in run
self.mainLoop()
File "/var/env/txircd/lib/python2.7/site-packages/twisted/internet/base.py", line 1201, in mainLoop
self.runUntilCurrent()
--- ---
File "/var/env/txircd/lib/python2.7/site-packages/twisted/internet/base.py", line 824, in runUntilCurrent
call.func(*call.args, **call.kw)
File "/var/env/txircd/txircd/txircd/user.py", line 203, in _timeoutRegistration
self.disconnect("Registration timeout")
File "/var/env/txircd/txircd/txircd/user.py", line 193, in disconnect
self.ircd.runActionStandard("quit", self, reason, users=self)
File "/var/env/txircd/txircd/txircd/ircd.py", line 486, in runActionStandard
action[0](*params, **kw)
File "/var/env/txircd/txircd/txircd/modules/rfc/cmd_whowas.py", line 40, in addUserToWhowas
lowerNick = ircLower(user.nick)
File "/var/env/txircd/txircd/txircd/utils.py", line 16, in ircLower
return string.lower().replace("[", "{").replace("]", "}").replace("\\", "|")
exceptions.AttributeError: 'NoneType' object has no attribute 'lower'