Skip to content

Commit

Permalink
Gracefully handles empty batches.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daverball committed Sep 6, 2022
1 parent cce08cd commit 250635b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions AIS/ais.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ def post(self, payload: str) -> Dict[str, Any]:
def sign_batch(self, pdfs: Sequence['PDF']) -> None:
"""Sign a batch of files."""

# Let's just return if the batch is empty somehow
if not pdfs:
return

# Let's not be pedantic and allow a batch of size 1
if len(pdfs) == 1:
return self.sign_one_pdf(pdfs[0])
Expand Down

0 comments on commit 250635b

Please sign in to comment.