Skip to content

Commit

Permalink
fix: index out of range error
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Lippert <[email protected]>

#35
  • Loading branch information
lippoliv committed Jul 23, 2024
1 parent 32d34c4 commit e8c6963
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 e8c6963

Please sign in to comment.