From 42cd6e0ecfae92f31d57ae1316b62925e3007ede Mon Sep 17 00:00:00 2001 From: devtooligan Date: Fri, 7 Jul 2023 12:13:22 -0700 Subject: [PATCH] fix: account for case w no functions --- slither/utils/halstead.py | 2 ++ 1 file changed, 2 insertions(+) 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: