Index: /applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintPreview.java
===================================================================
--- /applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintPreview.java	(revision 32168)
+++ /applications/editors/josm/plugins/print/src/org/openstreetmap/josm/plugins/print/PrintPreview.java	(revision 32169)
@@ -60,5 +60,5 @@
      * The PageFormat chosen for printing (and preview)
      */
-    protected transient PageFormat format = null;
+    protected transient PageFormat format;
     
     /**
@@ -76,10 +76,10 @@
      * When this flag is true, no painting operations will be performed.
      */
-    protected boolean paintingDisabled = false;
+    protected boolean paintingDisabled;
     
     /**
      * the printable object for rendering preview contents
      */
-    protected transient Printable printable = null;
+    protected transient Printable printable;
     
     /**
@@ -157,14 +157,14 @@
      * Zoom to fit the page size
      * 
-     * Set the zoom factor such that the whole page fits into the 
-     * preview area.
+     * Set the zoom factor such that the whole page fits into the preview area.
      */
     public void zoomToPage() {
+        if (format == null)
+            return;
         Container parent = getParent();
         Dimension dim;
         if (parent instanceof JViewport) {
             dim = getParent().getSize(); // could get rid of scrollbars
-        }
-        else {
+        } else {
             dim = getVisibleRect().getSize();
         }
@@ -290,15 +290,17 @@
 
         g2d.scale(scale, scale);
-        g2d.clip(new Rectangle2D.Double(format.getImageableX(), format.getImageableY(), format.getImageableWidth(), format.getImageableHeight()));
+        g2d.clip(new Rectangle2D.Double(
+                format.getImageableX(),
+                format.getImageableY(),
+                format.getImageableWidth(),
+                format.getImageableHeight()));
         if (printable != null) {
             try {
                 printable.print(g2d, format, 0);
-            }
-            catch (PrinterException e) {
+            } catch (PrinterException e) {
                 // should never happen since we are not printing
                 Main.error(e);
             }
-        }
-        else {
+        } else {
             g2d.setColor(Color.gray);
             g2d.fillRect(0, 0, (int)format.getWidth(), (int)format.getHeight());
