From 37dcae282afd5166ccd82f884e6d92f00cccde45 Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Tue, 20 Aug 2024 17:20:18 +0100 Subject: [PATCH] ExtractImagesController. null checks --- .../SPDF/controller/api/misc/ExtractImagesController.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/stirling/software/SPDF/controller/api/misc/ExtractImagesController.java b/src/main/java/stirling/software/SPDF/controller/api/misc/ExtractImagesController.java index dcbc00aa..62743a2b 100644 --- a/src/main/java/stirling/software/SPDF/controller/api/misc/ExtractImagesController.java +++ b/src/main/java/stirling/software/SPDF/controller/api/misc/ExtractImagesController.java @@ -140,6 +140,9 @@ public class ExtractImagesController { Set processedImages, ZipOutputStream zos) throws IOException { + if(page.getResources() == null || page.getResources().getXObjectNames() == null) { + return; + } for (COSName name : page.getResources().getXObjectNames()) { if (page.getResources().isImageXObject(name)) { PDImageXObject image = (PDImageXObject) page.getResources().getXObject(name);