Index: /trunk/src/org/openstreetmap/josm/data/imagery/WmsCache.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/imagery/WmsCache.java	(revision 4066)
+++ /trunk/src/org/openstreetmap/josm/data/imagery/WmsCache.java	(revision 4067)
@@ -178,4 +178,5 @@
 
     public synchronized void loadIndex() {
+        File indexFile = new File(cacheDir, INDEX_FILENAME);
         try {
             JAXBContext context = JAXBContext.newInstance(
@@ -183,6 +184,5 @@
                     WmsCacheType.class.getClassLoader());
             Unmarshaller unmarshaller = context.createUnmarshaller();
-            WmsCacheType cacheEntries = (WmsCacheType)unmarshaller.unmarshal(
-                    new FileInputStream(new File(cacheDir, INDEX_FILENAME)));
+            WmsCacheType cacheEntries = (WmsCacheType)unmarshaller.unmarshal(new FileInputStream(indexFile));
             totalFileSize = cacheEntries.getTotalFileSize();
             if (cacheEntries.getTileSize() != tileSize) {
@@ -201,6 +201,10 @@
             }
         } catch (Exception e) {
-            e.printStackTrace();
-            System.out.println("Unable to load index for wms-cache, new file will be created");
+            if (indexFile.exists()) {
+                e.printStackTrace();
+                System.out.println("Unable to load index for wms-cache, new file will be created");
+            } else {
+                System.out.println("Index for wms-cache doesn't exist, new file will be created");
+            }
         }
 
