Index: /trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 5411)
+++ /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 5412)
@@ -123,5 +123,5 @@
         @Override
         public String toString() {
-            return value.toString();
+            return value != null ? value.toString() : "null";
         }
     }
Index: /trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java	(revision 5411)
+++ /trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java	(revision 5412)
@@ -23,5 +23,4 @@
 import javax.swing.Icon;
 import javax.swing.ImageIcon;
-import javax.swing.InputMap;
 import javax.swing.JButton;
 import javax.swing.JComponent;
@@ -36,4 +35,5 @@
 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
+import org.openstreetmap.josm.data.Preferences.Setting;
 import org.openstreetmap.josm.data.osm.Changeset;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -500,9 +500,12 @@
         if (e.getKey() == null || ! e.getKey().equals("osm-server.url"))
             return;
-        if (e.getNewValue() == null) {
-            setTitle(tr("Upload"));
+        final Setting<?> newValue = e.getNewValue();
+        final String url;
+        if (newValue == null || newValue.getValue() == null) {
+            url = OsmApi.getOsmApi().getBaseUrl();
         } else {
-            setTitle(tr("Upload to ''{0}''", e.getNewValue()));
-        }
+            url = newValue.getValue().toString();
+        }
+        setTitle(tr("Upload to ''{0}''", url));
     }
 }
