fixed a traceback when trying to look for a detail that does not exist.

This commit is contained in:
Griatch 2012-12-12 01:33:49 +01:00
parent 9756314e3d
commit 9d79299d16

View file

@ -163,7 +163,11 @@ class ExtendedRoom(Room):
Details are not season-sensitive, but are parsed for timeslot markers.
"""
detail = self.db.details.get(key.lower(), None)
try:
detail = self.db.details.get(key.lower(), None)
except AttributeError:
# this happens if no attribute details is set at all
return None
if detail:
season, timeslot = self.get_time_and_season()
detail = self.replace_timeslots(detail, timeslot)