Skip to content

Commit

Permalink
added exception catch to nextcloud importer
Browse files Browse the repository at this point in the history
to handle empty folders in sync
  • Loading branch information
vabene1111 committed Jan 17, 2022
1 parent edd4787 commit e0b8d6f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cookbook/provider/nextcloud.py
Expand Up @@ -29,7 +29,11 @@ def import_all(monitor):
client = Nextcloud.get_client(monitor.storage)

files = client.list(monitor.path)
files.pop(0) # remove first element because its the folder itself

try:
files.pop(0) # remove first element because its the folder itself
except IndexError:
pass # folder is emtpy, no recipes will be imported

import_count = 0
for file in files:
Expand Down

0 comments on commit e0b8d6f

Please sign in to comment.