From 5250b3b8e70f7666ab613c1ece38ec86b00a090e Mon Sep 17 00:00:00 2001 From: Andrew Engelbrecht Date: Wed, 22 Jul 2015 10:02:30 -0400 Subject: [PATCH] fixed bug which occurred when the parsed email did not have a "To: " field. --- edward | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/edward b/edward index a5f7113..c05a350 100755 --- a/edward +++ b/edward @@ -411,12 +411,13 @@ def email_to_from_subject (email_text): def import_lang(email_to): - for lang in langs: - if "edward-" + lang in email_to: - lang = "lang." + re.sub('-', '_', lang) - language = importlib.import_module(lang) + if email_to != None: + for lang in langs: + if "edward-" + lang in email_to: + lang = "lang." + re.sub('-', '_', lang) + language = importlib.import_module(lang) - return language + return language return importlib.import_module("lang.en") -- 2.25.1