Skip to content

Commit 524a46b

Browse files
authored
Merge pull request #2 from pedrorubster/patch-1
Fixed issue where exception would be raised if the email contained th…
2 parents fb538e8 + ed2072c commit 524a46b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

TempMail/TempMail.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def getEmails(inbox):
5353
data = json.loads(s)
5454

5555
#Raise an exception if the token is invalid
56-
if "token" in s:
56+
if "token" in s and "token" in data:
5757
if data["token"] == "invalid":
5858
raise Exception("Invalid Token")
5959

@@ -66,4 +66,4 @@ def getEmails(inbox):
6666
for email in data["email"]:
6767
emails.append(Email(email["from"], email["to"], email["subject"], email["body"], email["html"], email["date"]))
6868
return emails
69-
69+

0 commit comments

Comments
 (0)