From d4f80a526eaed1af52584803af30d3dbf76049c5 Mon Sep 17 00:00:00 2001 From: Greg Taylor Date: Mon, 13 Apr 2009 13:16:13 +0000 Subject: [PATCH] Pass on KeyError from deleting a non-existant game from the IMC2MudList. --- src/imc2/trackers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/imc2/trackers.py b/src/imc2/trackers.py index 5899c248e9..9ab3ae2806 100644 --- a/src/imc2/trackers.py +++ b/src/imc2/trackers.py @@ -38,7 +38,11 @@ class IMC2MudList(object): def remove_mud_from_packet(self, packet): # Removes a mud from the Mud list when given a packet. mud = IMC2Mud(packet) - del self.mud_list[mud.name] + try: + del self.mud_list[mud.name] + except KeyError: + # No matching entry, no big deal. + pass # Use this instance to keep track of the other games on the network. IMC2_MUDLIST = IMC2MudList() \ No newline at end of file