Index: /trunk/src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 18997)
+++ /trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 18998)
@@ -438,4 +438,9 @@
         }
         if (!canContinue || ed.getValue() <= 1) { // 0 == cancel (we want to stop) and 1 == stop
+            // Never store cancel/stop -- this would otherwise lead to the user never seeing the window again, and JOSM just stopping.
+            if (ConditionalOptionPaneUtil.getDialogReturnValue("sanityCheckFailed") != -1) {
+                Config.getPref().put("message.sanityCheckFailed", null);
+                Config.getPref().put("message.sanityCheckFailed.value", null);
+            }
             Lifecycle.exitJosm(true, -1);
         }
