Index: trunk/src/org/openstreetmap/josm/io/OsmReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmReader.java	(revision 14093)
+++ trunk/src/org/openstreetmap/josm/io/OsmReader.java	(revision 14094)
@@ -138,6 +138,7 @@
 
     private void handleIllegalDataException(IllegalDataException e) throws XMLStreamException {
-        if (e.getCause() instanceof XMLStreamException) {
-            throw (XMLStreamException) e.getCause();
+        Throwable cause = e.getCause();
+        if (cause instanceof XMLStreamException) {
+            throw (XMLStreamException) cause;
         } else {
             throwException(e);
