Skip to content

Commit d8ef8a2

Browse files
committed
Revert "Revert "Add missing if idx < 0""
This reverts commit 64a9a01.
1 parent c418470 commit d8ef8a2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

aikido_zen/helpers/ip_matcher/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ def has(self, network):
2727
if not net or not net.is_valid():
2828
return False
2929
idx = binary_search_for_insertion_index(net, self.sorted)
30+
if idx < 0:
31+
return False
3032
if idx < len(self.sorted) and self.sorted[idx].contains(net):
3133
return True
3234
if idx - 1 >= 0 and self.sorted[idx - 1].contains(net):

0 commit comments

Comments
 (0)