Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/KmzReader.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/KmzReader.java	(revision 29937)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/KmzReader.java	(revision 29938)
@@ -17,6 +17,8 @@
 
 import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 
@@ -24,4 +26,5 @@
 import javax.xml.stream.XMLStreamException;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
@@ -42,12 +45,34 @@
 
 	private DataSet parseDoc(ProgressMonitor instance) throws IOException, XMLStreamException, FactoryConfigurationError  {
-		long size = zis.getNextEntry().getSize();
-		byte[] buffer = new byte[(int) size];
-		int off = 0;
-		int count = 0;
-		while ((count = zis.read(buffer, off, (int)size)) > 0) {
-			off += count;
-			size -= count;
-		}
+	    ZipEntry entry;
+	    do {
+	        entry = zis.getNextEntry();
+	        if (entry == null) {
+	            Main.warn("No KML file found");
+	            return null;
+	        }
+	    } while (!entry.getName().toLowerCase().endsWith(".kml"));
+		long size = entry.getSize();
+		byte[] buffer;
+		if (size > 0) {
+            buffer = new byte[(int) size];
+            int off = 0;
+            int count = 0;
+            while ((count = zis.read(buffer, off, (int) size)) > 0) {
+                off += count;
+                size -= count;
+            }
+        } else {
+            ByteArrayOutputStream out = new ByteArrayOutputStream();
+            int b;
+            do {
+                b = zis.read();
+                if (b != -1) {
+                    out.write(b);
+                }
+            } while (b != -1);
+            buffer = out.toByteArray();
+        }
+	    
 		return KmlReader.parseDataSet(new ByteArrayInputStream(buffer), instance);
 	}
