From 7c460dbf79469a27f1c8bd289d05b5544b7d1221 Mon Sep 17 00:00:00 2001 From: tkellner Date: Mon, 3 Feb 2014 16:15:02 +0000 Subject: NULL checks PDFOVER-1 #done Fixed #resolve git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@509 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../java/at/asit/pdfover/gui/composites/PositioningComposite.java | 3 ++- .../src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'pdf-over-gui') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java index 9c649f1c..8f90cd78 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java @@ -423,7 +423,8 @@ public class PositioningComposite extends StateComposite { */ public void setPosition(float x, float y, int page) { showPage(page); - this.viewer.setSignaturePosition(x, y); + if (this.viewer != null) + this.viewer.setSignaturePosition(x, y); } /** 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 b4933cb2..264ccd2f 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 @@ -335,9 +335,10 @@ public class SignaturePanel extends JPanel { } else { if ( - (this.sigScreenWidth != this.prevSigScreenWidth) || + ((this.sigScreenWidth != this.prevSigScreenWidth) || (this.sigScreenHeight != this.prevSigScreenHeight) || - (this.sigPlaceholderTransparency != this.prevSigPlaceholderTransparency)) + (this.sigPlaceholderTransparency != this.prevSigPlaceholderTransparency)) && + ((this.sigScreenWidth != 0) && (this.sigScreenHeight != 0))) { // redraw scaled transparent placeholder this.prevSigScreenWidth = this.sigScreenWidth; -- cgit v1.2.3