Index: /trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 18907)
+++ /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 18908)
@@ -918,4 +918,5 @@
      */
     private void updateMapPaintKnownDefaults() {
+        final String mapPaintStyleEntriesPrefEntry = "mappaint.style.entries";
         final String url = "url";
         final String active = "active";
@@ -933,6 +934,11 @@
         putList("mappaint.style.known-defaults", knownDefaults);
 
+        // If the user hasn't set the entries, don't go through the removal process for potlatch 2. There is an issue
+        // where it may clear all paintstyles (done when the user has never touched the style settings).
+        if (!this.settingsMap.containsKey(mapPaintStyleEntriesPrefEntry)) {
+            return;
+        }
         // Replace potlatch2 in the current style entries, but only if it is enabled. Otherwise, remove it.
-        final List<Map<String, String>> styleEntries = new ArrayList<>(getListOfMaps("mappaint.style.entries"));
+        final List<Map<String, String>> styleEntries = new ArrayList<>(getListOfMaps(mapPaintStyleEntriesPrefEntry));
         final boolean potlatchEnabled = styleEntries.stream().filter(map -> potlatch2.equals(map.get(url)))
                 .anyMatch(map -> Boolean.parseBoolean(map.get(active)));
@@ -946,5 +952,5 @@
             }
         }
-        putListOfMaps("mappaint.style.entries", styleEntries.isEmpty() ? null : styleEntries);
+        putListOfMaps(mapPaintStyleEntriesPrefEntry, styleEntries);
     }
 
