1
0
mirror of https://github.com/Stirling-Tools/Stirling-PDF.git synced 2024-11-23 15:21:25 +01:00

ExtractImagesController. null checks

This commit is contained in:
Anthony Stirling 2024-08-20 17:20:18 +01:00 committed by GitHub
parent 58618b3a21
commit 37dcae282a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -140,6 +140,9 @@ public class ExtractImagesController {
Set<Integer> 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);