From ddc3075e265aee39ad5b74836d2d452bdeea630c Mon Sep 17 00:00:00 2001 From: Brandon Miller Date: Thu, 5 Jun 2025 16:04:00 -0400 Subject: Handle None when querying IL in Python generators --- python/binaryview.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'python') 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: -- cgit v1.3.1