Index: /trunk/src/org/openstreetmap/josm/io/OsmServerObjectReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmServerObjectReader.java	(revision 1826)
+++ /trunk/src/org/openstreetmap/josm/io/OsmServerObjectReader.java	(revision 1827)
@@ -32,4 +32,5 @@
     public DataSet parseOsm(ProgressMonitor progressMonitor) throws OsmTransferException {
         progressMonitor.beginTask("", 1);
+        InputStream in = null;
         try {
             progressMonitor.subTask(tr("Downloading OSM data..."));
@@ -42,27 +43,24 @@
             }
 
-            final InputStream in = getInputStream(sb.toString(), progressMonitor.createSubTaskMonitor(1, true));
+            in = getInputStream(sb.toString(), progressMonitor.createSubTaskMonitor(1, true));
             if (in == null)
                 return null;
             final OsmReader osm = OsmReader.parseDataSetOsm(in, progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false));
             final DataSet data = osm.getDs();
-
-            in.close();
-            activeConnection = null;
             return data;
-        } catch (IOException e) {
-            if (cancel)
-                return null;
-            throw new OsmTransferException(e);
-        } catch (SAXException e) {
-            throw new OsmTransferException(e);
         } catch(OsmTransferException e) {
+            if (cancel) return null;
             throw e;
         } catch (Exception e) {
-            if (cancel)
-                return null;
+            if (cancel) return null;
             throw new OsmTransferException(e);
         } finally {
             progressMonitor.finishTask();
+            if (in!=null) {
+                try {
+                    in.close();
+                } catch(Exception e) {}
+            }
+            activeConnection = null;
         }
     }
