Ignore:
Timestamp:
2014-12-10T22:07:39+01:00 (11 years ago)
Author:
Don-vip
Message:

fix #10816 - add various safeguards to make sure to not upload empty keys

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java

    r7509 r7783  
    1818import java.util.concurrent.atomic.AtomicLong;
    1919
     20import org.openstreetmap.josm.tools.Utils;
     21
    2022/**
    2123* Abstract class to represent common features of the datatypes primitives.
     
    509511     * removes the key and behaves like {@link #remove(String)}.
    510512     *
    511      * @param key  The key, for which the value is to be set. Can be null, does nothing in this case.
     513     * @param key  The key, for which the value is to be set. Can be null or empty, does nothing in this case.
    512514     * @param value The value for the key. If null, removes the respective key/value pair.
    513515     *
     
    517519    public void put(String key, String value) {
    518520        Map<String, String> originalKeys = getKeys();
    519         if (key == null)
     521        if (key == null || Utils.strip(key).isEmpty())
    520522            return;
    521523        else if (value == null) {
Note: See TracChangeset for help on using the changeset viewer.