summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mail/src/leap/mail/utils.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mail/src/leap/mail/utils.py b/mail/src/leap/mail/utils.py
index 3ba4291..fed24b3 100644
--- a/mail/src/leap/mail/utils.py
+++ b/mail/src/leap/mail/utils.py
@@ -49,7 +49,7 @@ def empty(thing):
thing = thing.content
try:
return len(thing) == 0
- except ReferenceError:
+ except (ReferenceError, TypeError):
return True
@@ -267,6 +267,8 @@ class CustomJsonScanner(object):
if not monkey_patched:
return self._orig_scanstring(s, idx, *args, **kwargs)
+ # TODO profile to see if a compiled regex can get us some
+ # benefit here.
found = False
end = s.find("\"", idx)
while not found: