Add check for empty list

This commit is contained in:
Anna Levenberg 2020-09-22 09:33:12 -04:00 committed by Johannes 'josch' Schauer
parent b2c3b641db
commit 32b4ed1f43
Signed by: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -1991,6 +1991,9 @@ def convert(*images, **kwargs):
if not isinstance(images, (list, tuple)): if not isinstance(images, (list, tuple)):
images = [images] images = [images]
else:
if len(images) == 0:
raise ValueError("Unable to process empty list")
for img in images: for img in images:
# img is allowed to be a path, a binary string representing image data # img is allowed to be a path, a binary string representing image data