Skip to content

Commit

Permalink
Fixed error for non-existing regex file
Browse files Browse the repository at this point in the history
  • Loading branch information
blupants committed Aug 5, 2024
1 parent 6ba0b14 commit 038f64d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/n0s1/n0s1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -475,6 +476,8 @@ def main(callback=None):
parser = init_argparse()
args = parser.parse_args()

DEBUG = args.debug

regex_config = None
cfg = {}

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 038f64d

Please sign in to comment.