diff --git a/slither/utils/halstead.py b/slither/utils/halstead.py index f4426f60a9..829dc8035c 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: