Index: trunk/src/org/openstreetmap/josm/gui/io/TagSettingsPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/TagSettingsPanel.java	(revision 6305)
+++ trunk/src/org/openstreetmap/josm/gui/io/TagSettingsPanel.java	(revision 6309)
@@ -99,6 +99,6 @@
      * @return the map with the current tags in the tag editor model.
      */
-    public Map<String,String> getTags() {
-        return pnlTagEditor.getModel().getTags();
+    public Map<String,String> getTags(boolean keepEmpty) {
+        return pnlTagEditor.getModel().getTags(keepEmpty);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java	(revision 6305)
+++ trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java	(revision 6309)
@@ -4,4 +4,5 @@
 import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
 import static org.openstreetmap.josm.tools.I18n.tr;
+import static org.openstreetmap.josm.tools.I18n.trn;
 
 import java.awt.BorderLayout;
@@ -52,4 +53,5 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.InputMapUtils;
+import org.openstreetmap.josm.tools.Utils;
 import org.openstreetmap.josm.tools.WindowGeometry;
 
@@ -299,5 +301,5 @@
             cs = new Changeset();
         }
-        cs.setKeys(pnlTagSettings.getTags());
+        cs.setKeys(pnlTagSettings.getTags(false));
         return cs;
     }
@@ -454,4 +456,28 @@
                 }
             }
+
+            /* test for empty tags in the changeset metadata and proceed only after user's confirmation */
+            List<String> emptyChangesetTags = new ArrayList<String>();
+            for (final Entry<String, String> i : pnlTagSettings.getTags(true).entrySet()) {
+                if (i.getKey() == null || i.getKey().trim().isEmpty()
+                        || i.getValue() == null || i.getValue().trim().isEmpty()) {
+                    emptyChangesetTags.add(tr("{0}={1}", i.getKey(), i.getValue()));
+                }
+            }
+            if (!emptyChangesetTags.isEmpty() && JOptionPane.OK_OPTION != JOptionPane.showConfirmDialog(
+                    Main.parent,
+                    trn(
+                            "<html>The following changeset tag contains an empty key/value:<br>{0}<br>Continue?</html>",
+                            "<html>The following changeset tags contain an empty key/value:<br>{0}<br>Continue?</html>",
+                            emptyChangesetTags.size(), Utils.joinAsHtmlUnorderedList(emptyChangesetTags)),
+                    tr("Empty metadata"),
+                    JOptionPane.OK_CANCEL_OPTION,
+                    JOptionPane.WARNING_MESSAGE
+            )) {
+                tpConfigPanels.setSelectedIndex(0);
+                pnlBasicUploadSettings.initEditingOfUploadComment();
+                return;
+            }
+
             UploadStrategySpecification strategy = getUploadStrategySpecification();
             if (strategy.getStrategy().equals(UploadStrategy.CHUNKED_DATASET_STRATEGY)) {
Index: trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java	(revision 6305)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java	(revision 6309)
@@ -410,5 +410,5 @@
     public void applyToPrimitive(Tagged primitive) {
         Map<String,String> tags = primitive.getKeys();
-        applyToTags(tags);
+        applyToTags(tags, false);
         primitive.setKeys(tags);
     }
@@ -420,5 +420,5 @@
      *
      */
-    public void applyToTags(Map<String, String> tags) {
+    public void applyToTags(Map<String, String> tags, boolean keepEmpty) {
         tags.clear();
         for (TagModel tag: this.tags) {
@@ -431,5 +431,5 @@
             // tag name holds an empty key. Don't apply it to the selection.
             //
-            if (tag.getName().trim().isEmpty() || tag.getValue().trim().isEmpty()) {
+            if (!keepEmpty && (tag.getName().trim().isEmpty() || tag.getValue().trim().isEmpty())) {
                 continue;
             }
@@ -439,6 +439,10 @@
 
     public Map<String,String> getTags() {
+        return getTags(false);
+    }
+
+    public Map<String,String> getTags(boolean keepEmpty) {
         Map<String,String> tags = new HashMap<String, String>();
-        applyToTags(tags);
+        applyToTags(tags, keepEmpty);
         return tags;
     }
