diff --git a/slither/utils/halstead.py b/slither/utils/halstead.py index 93552c9cd3..a5ab41cc9b 100644 --- a/slither/utils/halstead.py +++ b/slither/utils/halstead.py @@ -86,6 +86,8 @@ def populate_operators_and_operands(self): """Populate the operators and operands lists.""" operators = [] operands = [] + if not hasattr(self.contract, "functions"): + return for func in self.contract.functions: for node in func.nodes: for operation in node.irs: