From 038f64dd0a96f475067f07d57b11e5f6f41da56a Mon Sep 17 00:00:00 2001 From: blupants Date: Mon, 5 Aug 2024 10:52:50 -0500 Subject: [PATCH] Fixed error for non-existing regex file --- src/n0s1/n0s1.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/n0s1/n0s1.py b/src/n0s1/n0s1.py index 90ef2f6..76dfa50 100755 --- a/src/n0s1/n0s1.py +++ b/src/n0s1/n0s1.py @@ -421,6 +421,7 @@ def scan_text(regex_config, text): def scan(regex_config, controller, scan_arguments): global DEBUG if not regex_config or not controller: + raise ValueError("No regex configuration provided to the scanner") return scan_comment = scan_arguments.get("scan_comment", False) post_comment = scan_arguments.get("post_comment", False) @@ -475,6 +476,8 @@ def main(callback=None): parser = init_argparse() args = parser.parse_args() + DEBUG = args.debug + regex_config = None cfg = {} @@ -596,8 +599,6 @@ def main(callback=None): parser.print_help() return - DEBUG = args.debug - message = f"n0s1 secret scanner version [{n0s1_version}] - Scan date: {date_utc}" log_message(message) if DEBUG: