From 1ee36f1c426ad6a7175f27cc0f1e014093ed6f6c Mon Sep 17 00:00:00 2001 From: LoRexxar Date: Fri, 10 Sep 2021 19:06:33 +0800 Subject: [PATCH] fix a little bug --- core/cli.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/cli.py b/core/cli.py index 755a0988..793fff02 100644 --- a/core/cli.py +++ b/core/cli.py @@ -15,6 +15,7 @@ import os import codecs import pprint +import traceback from prettytable import PrettyTable from .detection import Detection @@ -140,8 +141,13 @@ def display_result(scan_id, is_ask=False): logger.info("[Chain] Vul {}".format(sr.id)) for rf in rfs: logger.info("[Chain] {}, {}, {}:{}".format(rf.node_type, rf.node_content, rf.node_path, rf.node_lineno)) - if not show_context(rf.node_path, rf.node_lineno): - logger_console.info(rf.node_source) + + try: + if not show_context(rf.node_path, rf.node_lineno): + logger_console.info(rf.node_source) + except: + logger.error("[SCAN] Error: {}".format(traceback.print_exc())) + continue logger.info( "[SCAN] ending\r\n -------------------------------------------------------------------------")