aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-lib
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-as-lib')
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java
index 0c2d8fbf..dcf1887a 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java
@@ -226,12 +226,28 @@ public class PdfAsImpl implements PdfAs, IConfigurationConstants {
.getDataSource().getByteData()));
COSDictionary trailer = doc.getDocument().getTrailer();
+ if(trailer == null) {
+ // No signatures ...
+ return result;
+ }
COSDictionary root = (COSDictionary) trailer
.getDictionaryObject(COSName.ROOT);
+ if(root == null) {
+ // No signatures ...
+ return result;
+ }
COSDictionary acroForm = (COSDictionary) root
.getDictionaryObject(COSName.ACRO_FORM);
+ if(acroForm == null) {
+ // No signatures ...
+ return result;
+ }
COSArray fields = (COSArray) acroForm
.getDictionaryObject(COSName.FIELDS);
+ if(fields == null) {
+ // No signatures ...
+ return result;
+ }
int lastSig = -1;
for (int i = 0; i < fields.size(); i++) {