Changeset 7516 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2014-09-09T17:26:16+02:00 (10 years ago)
Author:
Don-vip
Message:

fix #10496 - NoSuchElementException with empty chunk in preset

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetReader.java

    r7248 r7516  
    115115                o = lastIdIterators.peek().next();
    116116                if (!lastIdIterators.peek().hasNext()) {
    117                     // remove iterator is is empty
     117                    // remove iterator if is empty
    118118                    lastIdIterators.pop();
    119119                }
     
    146146                    throw new SAXException(tr("Reference {0} is being used before it was defined", ref));
    147147                }
    148                 lastIdIterators.push(byId.get(ref).iterator());
     148                Iterator<Object> it = byId.get(ref).iterator();
     149                if (it.hasNext()) {
     150                    lastIdIterators.push(it);
     151                } else {
     152                    Main.warn("Ignoring reference '"+ref+"' denoting an empty chunk");
     153                }
    149154                continue;
    150155            }
Note: See TracChangeset for help on using the changeset viewer.