Index: /trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java	(revision 8339)
+++ /trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java	(revision 8340)
@@ -61,16 +61,16 @@
             try {
                 instance4.stopServer();
-                instance4 = null;
             } catch (IOException ioe) {
                 Main.error(ioe);
             }
+            instance4 = null;
         }
         if (instance6 != null) {
             try {
                 instance6.stopServer();
-                instance6 = null;
             } catch (IOException ioe) {
                 Main.error(ioe);
             }
+            instance6 = null;
         }
     }
Index: /trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java	(revision 8339)
+++ /trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java	(revision 8340)
@@ -351,16 +351,16 @@
             try {
                 instance4.stopServer();
-                instance4 = null;
             } catch (IOException ioe) {
                 Main.error(ioe);
             }
+            instance4 = null;
         }
         if (instance6 != null) {
             try {
                 instance6.stopServer();
-                instance6 = null;
             } catch (IOException ioe) {
                 Main.error(ioe);
             }
+            instance6 = null;
         }
     }
