summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorBrandon Miller <brandon@vector35.com>2025-06-05 16:04:00 -0400
committerBrandon Miller <brandon@vector35.com>2025-06-06 08:12:04 -0400
commitddc3075e265aee39ad5b74836d2d452bdeea630c (patch)
tree4bce7c064b08d8e370c0f778a12b047f42424eb2 /python
parent6143812268396746285198192329201043572405 (diff)
Handle None when querying IL in Python generators
Diffstat (limited to 'python')
-rw-r--r--python/binaryview.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/python/binaryview.py b/python/binaryview.py
index 60a910d6..d320d675 100644
--- a/python/binaryview.py
+++ b/python/binaryview.py
@@ -2998,13 +2998,15 @@ class BinaryView:
def mlil_basic_blocks(self) -> Generator['mediumlevelil.MediumLevelILBasicBlock', None, None]:
"""A generator of all MediumLevelILBasicBlock objects in the BinaryView"""
for func in self.mlil_functions():
- yield from func.basic_blocks
+ if func is not None:
+ yield from func.basic_blocks
@property
def hlil_basic_blocks(self) -> Generator['highlevelil.HighLevelILBasicBlock', None, None]:
"""A generator of all HighLevelILBasicBlock objects in the BinaryView"""
for func in self.hlil_functions():
- yield from func.basic_blocks
+ if func is not None:
+ yield from func.basic_blocks
@property
def instructions(self) -> InstructionsType: