summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java
diff options
context:
space:
mode:
authorJakob Heher <jakob.heher@iaik.tugraz.at>2022-05-05 14:08:07 +0200
committerJakob Heher <jakob.heher@iaik.tugraz.at>2022-05-05 14:08:07 +0200
commit1ac240dcf95343fbdd4c40563203bab5fd204c8f (patch)
treee4ded440baefb10c0037e0609e988459a63120b5 /pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java
parente00f1a6ed5766f80357661f47686c0822e1f7e0e (diff)
downloadpdf-over-1ac240dcf95343fbdd4c40563203bab5fd204c8f.tar.gz
pdf-over-1ac240dcf95343fbdd4c40563203bab5fd204c8f.tar.bz2
pdf-over-1ac240dcf95343fbdd4c40563203bab5fd204c8f.zip
(make an attempt to) make java close files; cf. #86
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java
index 34dd6c5e..1911ac67 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java
@@ -129,8 +129,17 @@ public class SignaturePanel extends JPanel {
public void setDocument(PDFFile pdf) {
this.pdf = pdf;
this.sigPagePos = null;
- this.numPages = pdf.getNumPages();
- showPage(this.numPages);
+ if (pdf != null)
+ {
+ this.numPages = pdf.getNumPages();
+ showPage(this.numPages);
+ }
+ else
+ {
+ this.page = 0;
+ this.numPages = 0;
+ showPage(null);
+ }
}
/**