From 25cc00d4c48c867f9c5c82685cb5e747253d1051 Mon Sep 17 00:00:00 2001 From: Jakob Heher Date: Tue, 22 Feb 2022 19:37:55 +0100 Subject: add workaround for PDF-AS exception handling bug (cf. #52) --- .../java/at/asit/pdfover/gui/workflow/states/SigningState.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pdf-over-gui/src') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/SigningState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/SigningState.java index e6884fb6..740c7d87 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/SigningState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/SigningState.java @@ -93,6 +93,16 @@ public class SigningState extends State { } if(this.threadException != null) { + // workaround for PDF-AS nullpointerexception intercepting our IllegalStateException + // cf. issue #52 + // this is a bit of a hack... + if (status.getPreviousState() instanceof MobileBKUState) + { + String mobileBkuError = ((MobileBKUState)status.getPreviousState()).getStatus().getErrorMessage(); + if (mobileBkuError.equals("cancel")) + this.threadException = new SignatureException(new IllegalStateException()); + } + String message = Messages.getString("error.Signatur"); //$NON-NLS-1$ if (this.threadException instanceof SignatureException) { Throwable cause = this.threadException; -- cgit v1.2.3