diff --git a/units.py b/units.py index f7eaeb789c..abf49f43d2 100644 --- a/units.py +++ b/units.py @@ -40,7 +40,7 @@ def temperature(bot, trigger): """ try: source = find_temp.match(trigger.group(2)).groups() - except AttributeError: + except (AttributeError, TypeError): bot.reply("That's not a valid temperature.") return NOLIMIT unit = source[1].upper() @@ -71,7 +71,7 @@ def distance(bot, trigger): """ try: source = find_length.match(trigger.group(2)).groups() - except AttributeError: + except (AttributeError, TypeError): bot.reply("That's not a valid length unit.") return NOLIMIT unit = source[1].lower()