From a5c35efe2bcc36009de6948a4a55dcdc9424ccb6 Mon Sep 17 00:00:00 2001 From: Josselin Date: Fri, 7 May 2021 15:21:59 +0200 Subject: [PATCH] Fix minor dict access issue --- slither/solc_parsing/expressions/expression_parsing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slither/solc_parsing/expressions/expression_parsing.py b/slither/solc_parsing/expressions/expression_parsing.py index 796b43ca6..ebe20b9fa 100644 --- a/slither/solc_parsing/expressions/expression_parsing.py +++ b/slither/solc_parsing/expressions/expression_parsing.py @@ -729,7 +729,7 @@ def parse_expression(expression: Dict, caller_context: CallerContext) -> "Expres assert "children" not in expression if is_compact_ast: - value = expression["value"] + value = expression.get("value", None) if value: if "subdenomination" in expression and expression["subdenomination"]: subdenomination = expression["subdenomination"] @@ -742,7 +742,7 @@ def parse_expression(expression: Dict, caller_context: CallerContext) -> "Expres if expression["kind"] == "number": type_candidate = "int_const" else: - value = expression["attributes"]["value"] + value = expression["attributes"].get("value", None) if value: if ( "subdenomination" in expression["attributes"]