Index: /trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 8861)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 8862)
@@ -160,8 +160,4 @@
         this.setVisible(true);
         MapView.addZoomChangeListener(this);
-        this.tileSource = getTileSource(info);
-        if (this.tileSource == null) {
-            throw new IllegalArgumentException(tr("Failed to create tile source"));
-        }
     }
 
@@ -506,4 +502,11 @@
     @Override
     public void hookUpMapView() {
+        // this needs to be here and not in constructor to allow empty TileSource class construction
+        // using SessionWriter
+        this.tileSource = getTileSource(info);
+        if (this.tileSource == null) {
+            throw new IllegalArgumentException(tr("Failed to create tile source"));
+        }
+
         super.hookUpMapView();
         projectionChanged(null, Main.getProjection()); // check if projection is supported
