Skip to content

Commit

Permalink
ExtractImagesController. null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Frooodle authored Aug 20, 2024
1 parent 58618b3 commit 37dcae2
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ private void extractImagesFromPage(
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);
Expand Down

0 comments on commit 37dcae2

Please sign in to comment.