diff --git a/slither/solc_parsing/declarations/function.py b/slither/solc_parsing/declarations/function.py index 4c21e72f1..3107e4974 100644 --- a/slither/solc_parsing/declarations/function.py +++ b/slither/solc_parsing/declarations/function.py @@ -895,7 +895,7 @@ class FunctionSolc: return_node = self._new_node(NodeType.RETURN, statement["src"]) link_underlying_nodes(node, return_node) if self.is_compact_ast: - if statement["expression"]: + if statement.get("expression", None): return_node.add_unparsed_expression(statement["expression"]) else: if (