Trap some more odd errors to assist in my tracking down their origin.

This commit is contained in:
Greg Taylor 2009-03-26 14:03:41 +00:00
parent 51edc17d59
commit 71a76cd1fb
3 changed files with 19 additions and 3 deletions

View file

@ -107,7 +107,11 @@ class SessionProtocol(StatefulTelnetProtocol):
pobject = self.get_pobject()
if pobject:
pobject.set_flag("CONNECTED", False)
pobject.get_location().emit_to_contents("%s has disconnected." % (pobject.get_name(show_dbref=False),), exclude=pobject)
location = pobject.get_location()
if location != None:
location.emit_to_contents("%s has disconnected." % (pobject.get_name(show_dbref=False),), exclude=pobject)
uaccount = pobject.get_user_account()
uaccount.last_login = datetime.now()
uaccount.save()