aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-pdfbox/src/main/java/at
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2015-03-06 14:56:41 +0100
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2015-03-06 14:56:41 +0100
commitc126ae50c21765ecd2883f613969caf02fefa308 (patch)
treebbc589a51b6a82fdf9b9e95d33354ce61ef38f23 /pdf-as-pdfbox/src/main/java/at
parentfc8df1cc58e5a388d6c6f2aac3ce3e0003e580b6 (diff)
downloadpdf-as-4-c126ae50c21765ecd2883f613969caf02fefa308.tar.gz
pdf-as-4-c126ae50c21765ecd2883f613969caf02fefa308.tar.bz2
pdf-as-4-c126ae50c21765ecd2883f613969caf02fefa308.zip
fixed null reference exception: QR Code search in page without content
Diffstat (limited to 'pdf-as-pdfbox/src/main/java/at')
-rw-r--r--pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox/placeholder/SignaturePlaceholderExtractor.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox/placeholder/SignaturePlaceholderExtractor.java b/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox/placeholder/SignaturePlaceholderExtractor.java
index 7990a094..9d2f7717 100644
--- a/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox/placeholder/SignaturePlaceholderExtractor.java
+++ b/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox/placeholder/SignaturePlaceholderExtractor.java
@@ -147,8 +147,11 @@ public class SignaturePlaceholderExtractor extends PDFStreamEngine {
PDPage page = (PDPage) iter.next();
try {
extractor.setCurrentPage(pageNr);
- extractor.processStream(page, page.findResources(), page
+ if(page.getContents() != null && page.findResources() != null &&
+ page.getContents().getStream() != null) {
+ extractor.processStream(page, page.findResources(), page
.getContents().getStream());
+ }
SignaturePlaceholderData ret = matchPlaceholderPage(
extractor.placeholders, placeholderId, matchMode);
if (ret != null) {
@@ -158,6 +161,8 @@ public class SignaturePlaceholderExtractor extends PDFStreamEngine {
}
} catch (IOException e1) {
throw new PDFIOException("error.pdf.io.04", e1);
+ } catch(Throwable e) {
+ throw new PDFIOException("error.pdf.io.04", e);
}
}