summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changes/bug_fix-first1
-rw-r--r--src/leap/bitmask/util/__init__.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/changes/bug_fix-first b/changes/bug_fix-first
new file mode 100644
index 00000000..0ef5188c
--- /dev/null
+++ b/changes/bug_fix-first
@@ -0,0 +1 @@
+ o Catch IndexError on `first` utility.
diff --git a/src/leap/bitmask/util/__init__.py b/src/leap/bitmask/util/__init__.py
index 6dd18bcf..78efcb6e 100644
--- a/src/leap/bitmask/util/__init__.py
+++ b/src/leap/bitmask/util/__init__.py
@@ -27,7 +27,7 @@ def first(things):
"""
try:
return things[0]
- except TypeError:
+ except (IndexError, TypeError):
return None