diff options
author | defanor <defanor@uberspace.net> | 2022-01-08 01:30:31 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2022-01-08 01:30:31 +0300 |
commit | 76afcefd528c46bfc2a482b5a56aa588e8704a11 (patch) | |
tree | 4569c877d22aa7bc54a9093bb964c7d4dc243f97 | |
parent | 16555c6cf9b6fa8f4348f6620c0b090e959d36f0 (diff) |
dwproxy.py: handle a KeyError in case if there's no room identifier
-rwxr-xr-x | dwproxy.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -80,13 +80,14 @@ class TelnetHandler(socketserver.BaseRequestHandler): def process_cmd(self, s): """Processes client commands.""" - # Return at once if we don't have room information - if not self.gmcp_data['room.info']['identifier']: + try: + cur_room_id = self.gmcp_data['room.info']['identifier'] + except KeyError: + # Return if we don't have room information return False cur = self.server.dbcur - cur_room_id = self.gmcp_data['room.info']['identifier'] origin_room = cur_room_id sw_match = sw_cmd.match(s) |