From f0ad772c383fca530a533f9c7241013a5bc2cfc0 Mon Sep 17 00:00:00 2001
From: Doug Szeto <douglas.szeto@slalom.com>
Date: Tue, 4 Jun 2024 13:29:15 -0400
Subject: [PATCH] updates scan pattern retrieval to allow for none

---
 secureli/actions/scan.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/secureli/actions/scan.py b/secureli/actions/scan.py
index 6c687def..d9464058 100644
--- a/secureli/actions/scan.py
+++ b/secureli/actions/scan.py
@@ -225,5 +225,10 @@ def _get_commited_files(self, scan_mode: ScanMode) -> list[Path]:
 
     def _get_custom_scan_patterns(self, folder_path: Path) -> list[Path]:
         settings = self.action_deps.settings.load(folder_path)
-        custom_scan_patterns = settings.scan_patterns.custom_scan_patterns
-        return custom_scan_patterns
+        if (
+            settings.scan_patterns is not None
+            and settings.scan_patterns.custom_scan_patterns is not None
+        ):
+            custom_scan_patterns = settings.scan_patterns.custom_scan_patterns
+            return custom_scan_patterns
+        return []