Skip to content

Commit

Permalink
fix: index out of range error (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
lippoliv authored Jul 23, 2024
2 parents 32d34c4 + e8c6963 commit f237d90
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ def paperlessngx_lookup_new_documents():
data = json.loads(response.content)
new_document_ids = sorted(data['all'])
if last_downloaded_document_id == 0:
last_downloaded_document_id = new_document_ids[len(new_document_ids) - 1]
if len(new_document_ids):
last_downloaded_document_id = new_document_ids[len(new_document_ids) - 1]

return

# download found documents
Expand Down

0 comments on commit f237d90

Please sign in to comment.