Return an empty scans list if the folder is missing

This commit is contained in:
Richard Bowman 2024-01-11 13:40:47 +00:00
parent 6b6946ec60
commit f4c4206a53

View file

@ -650,6 +650,8 @@ class SmartScanThing(Thing):
in the `images` folder.
"""
scans: list[ScanInfo] = []
if not os.path.isdir(self.scans_folder_path):
return scans
for f in os.listdir(self.scans_folder_path):
path = os.path.join(self.scans_folder_path, f)
if os.path.isdir(path):