Index: /trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 3708)
+++ /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 3709)
@@ -616,8 +616,14 @@
     }
 
+    /**
+     * Get a list of values for a certain key
+     * @param key the identifier for the setting
+     * @param def the default value.
+     * @return the corresponding value if the property has been set before,
+     *  def otherwise
+     */
     synchronized public Collection<String> getCollection(String key, Collection<String> def) {
+        putCollectionDefault(key, def);
         String s = get(key);
-        if(def != null)
-            putCollectionDefault(key, def);
         if(s != null && s.length() != 0)
             return Arrays.asList(s.split("\u001e"));
@@ -651,14 +657,18 @@
     
     synchronized private void putCollectionDefault(String key, Collection<String> val) {
-        String s = null;
-        for(String a : val)
-        {
-            if(s != null) {
-                s += "\u001e" + a;
-            } else {
-                s = a;
-            }
-        }
-        putDefault(key, s);
+        if (val == null) {
+            putDefault(key, null);
+        } else {
+            String s = null;
+            for(String a : val)
+            {
+                if(s != null) {
+                    s += "\u001e" + a;
+                } else {
+                    s = a;
+                }
+            }
+            putDefault(key, s);
+        }
     }
     
