diff --git a/pptx/package.py b/pptx/package.py index 7339c7c4f..92afee679 100644 --- a/pptx/package.py +++ b/pptx/package.py @@ -58,6 +58,7 @@ def first_available_image_idx(): image_idxs = sorted([ part.partname.idx for part in self.iter_parts() if part.partname.startswith('/ppt/media/image') + and part.partname.idx is not None ]) for i, image_idx in enumerate(image_idxs): idx = i + 1