Skip to content

Commit d6fe8b6

Browse files
committed
Handle None when querying IL in Python generators
1 parent 13a6e9a commit d6fe8b6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

python/binaryview.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2986,13 +2986,15 @@ def llil_basic_blocks(self) -> Generator['lowlevelil.LowLevelILBasicBlock', None
29862986
def mlil_basic_blocks(self) -> Generator['mediumlevelil.MediumLevelILBasicBlock', None, None]:
29872987
"""A generator of all MediumLevelILBasicBlock objects in the BinaryView"""
29882988
for func in self.mlil_functions():
2989-
yield from func.basic_blocks
2989+
if func is not None:
2990+
yield from func.basic_blocks
29902991

29912992
@property
29922993
def hlil_basic_blocks(self) -> Generator['highlevelil.HighLevelILBasicBlock', None, None]:
29932994
"""A generator of all HighLevelILBasicBlock objects in the BinaryView"""
29942995
for func in self.hlil_functions():
2995-
yield from func.basic_blocks
2996+
if func is not None:
2997+
yield from func.basic_blocks
29962998

29972999
@property
29983000
def instructions(self) -> InstructionsType:

0 commit comments

Comments
 (0)