From 32b4ed1f436278aeff737ee09d09f79bf8440275 Mon Sep 17 00:00:00 2001 From: Anna Levenberg Date: Tue, 22 Sep 2020 09:33:12 -0400 Subject: [PATCH] Add check for empty list --- src/img2pdf.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/img2pdf.py b/src/img2pdf.py index 384117f..042c82f 100755 --- a/src/img2pdf.py +++ b/src/img2pdf.py @@ -1991,6 +1991,9 @@ def convert(*images, **kwargs): if not isinstance(images, (list, tuple)): images = [images] + else: + if len(images) == 0: + raise ValueError("Unable to process empty list") for img in images: # img is allowed to be a path, a binary string representing image data