mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-01-07 14:39:46 +01:00
Fix error with iterative option in empty directory
This commit is contained in:
parent
1f134ac9af
commit
1ff36760d3
@ -79,7 +79,11 @@ def get_next_image(img_dir, recursive):
|
||||
image = images[next_index]
|
||||
|
||||
except IndexError:
|
||||
image = images[0]
|
||||
if images:
|
||||
image = images[0]
|
||||
else:
|
||||
logging.error("No images found in directory.")
|
||||
sys.exit(1)
|
||||
|
||||
return os.path.join(img_dir if not recursive else "", image)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user