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 b4624a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ 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 last_downloaded_dπocument_id == 0:
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 b4624a1

Please sign in to comment.