RED-7080: Fixed NPE in OCGWatermark removal
This commit is contained in:
parent
a462911b64
commit
8d06304723
@ -28,10 +28,12 @@ public class OCGWatermarkRemovalService {
|
||||
@SneakyThrows
|
||||
private boolean hasOCGWatermarks(PDFDoc pdfDoc) {
|
||||
Obj ocgs = pdfDoc.getOCGs();
|
||||
for (int i = 0; i < ocgs.size(); i++) {
|
||||
Group group = new Group(ocgs.getAt(i));
|
||||
if (group.isValid() && group.getName().equals("Watermark")) {
|
||||
return true;
|
||||
if(ocgs != null) {
|
||||
for (int i = 0; i < ocgs.size(); i++) {
|
||||
Group group = new Group(ocgs.getAt(i));
|
||||
if (group.isValid() && group.getName().equals("Watermark")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user