From 4512775dfe5aa8ed26f8de199ffe8cfc33549eea Mon Sep 17 00:00:00 2001 From: Greg Taylor Date: Mon, 6 Apr 2009 17:18:43 +0000 Subject: [PATCH] Fix an error when sending an invalid command at the login screen. Still hadn't adjusted to the new Command object handling messaging. --- src/cmdhandler.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/cmdhandler.py b/src/cmdhandler.py index 8d9142a988..5d864129fa 100755 --- a/src/cmdhandler.py +++ b/src/cmdhandler.py @@ -344,4 +344,13 @@ def handle(command): pass except UnknownCommand: # Default fall-through. No valid command match. - command.source_object.emit_to("Huh? (Type \"help\" for help.)") + if command.source_object != None: + # A typical logged in or object-based error message. + command.source_object.emit_to("Huh? (Type \"help\" for help.)") + elif command.session != None: + # This is hit when invalid commands are sent at the login screen + # primarily. Also protect against bad things in odd cases. + command.session.msg("Huh? (Type \"help\" for help.)") + else: + # We should never get to this point, but if we do, don't freak out. + pass