aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2026-03-04 17:52:52 +0100
committerThomas Lenz <thomas.lenz@egiz.gv.at>2026-03-04 17:52:52 +0100
commitbbb7dc4aec8ad9108b66eeb99e88bb52c8a4966f (patch)
tree78841c33618ce27327a586d5f8d52361ab59a5cf
parent04b752f38832e309d96392f0c1a3a6e02de55edc (diff)
downloadpdf-as-4-bbb7dc4aec8ad9108b66eeb99e88bb52c8a4966f.tar.gz
pdf-as-4-bbb7dc4aec8ad9108b66eeb99e88bb52c8a4966f.tar.bz2
pdf-as-4-bbb7dc4aec8ad9108b66eeb99e88bb52c8a4966f.zip
fix(core): add null check for signed document in process to avoid NullPointerException
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/PdfAsImpl.java10
1 files changed, 9 insertions, 1 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 ebd8ec90..255c76e6 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
@@ -537,7 +537,15 @@ public class PdfAsImpl implements PdfAs, IConfigurationConstants,
}
private SignResult createSignResult(OperationStatus status)
- throws IOException {
+ throws IOException, PDFASError {
+
+ if (status.getPdfObject().getSignedDocument() == null
+ || status.getPdfObject().getSignedDocument().length <= 0) {
+ logger.warn("No signed document in session. Maybe signing-service communication stopped by an error");
+ throw new PDFASError(ERROR_SIG_INVALID_STATUS,
+ "No signed document in session. Maybe signing-service communication stopped by an error");
+ }
+
// ================================================================
// Create SignResult
final SignResultImpl result = new SignResultImpl();