From 6a2e1e0819f0dde932484b20bb0e0d3e39293adf Mon Sep 17 00:00:00 2001 From: Mathis Date: Fri, 17 Jun 2022 08:40:42 -0700 Subject: [PATCH] Do not fail with no results and sarif output (#1229) Close #1228 --- slither/utils/output.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slither/utils/output.py b/slither/utils/output.py index 16c9f5bbf..6ee59b4c6 100644 --- a/slither/utils/output.py +++ b/slither/utils/output.py @@ -160,7 +160,7 @@ def output_to_sarif( ], } - for detector in results["detectors"]: + for detector in results.get("detectors", []): _output_result_to_sarif(detector, detectors_classes, sarif) if filename == "-":