Changeset 7714 in josm for trunk/src/org


Ignore:
Timestamp:
2014-11-07T20:12:40+01:00 (9 years ago)
Author:
Don-vip
Message:

fix #9564 - NPE

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

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

    r7575 r7714  
    947947     */
    948948    public OsmPrimitive getPrimitiveById(PrimitiveId primitiveId) {
    949         return primitivesMap.get(primitiveId);
     949        return primitiveId != null ? primitivesMap.get(primitiveId) : null;
    950950    }
    951951
     
    957957    private OsmPrimitive getPrimitiveByIdChecked(PrimitiveId primitiveId) {
    958958        OsmPrimitive result = getPrimitiveById(primitiveId);
    959         if (result == null) {
     959        if (result == null && primitiveId != null) {
    960960            Main.warn(tr("JOSM expected to find primitive [{0} {1}] in dataset but it is not there. Please report this "
    961961                    + "at {2}. This is not a critical error, it should be safe to continue in your work.",
  • trunk/src/org/openstreetmap/josm/gui/MapStatus.java

    r7483 r7714  
    475475
    476476            // This will cycle through the available items.
    477             if(firstSelected == null) {
    478                 ds.addSelected(firstItem);
    479             } else {
     477            if (firstSelected != null) {
    480478                ds.clearSelection(firstSelected);
    481479                if(nextSelected != null) {
    482480                    ds.addSelected(nextSelected);
    483481                }
     482            } else if (firstItem != null) {
     483                ds.addSelected(firstItem);
    484484            }
    485485        }
Note: See TracChangeset for help on using the changeset viewer.