Changeset 8914 in josm for trunk/src/org


Ignore:
Timestamp:
2015-10-19T23:49:11+02:00 (9 years ago)
Author:
Don-vip
Message:

improve unit tests

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/conflict/ConflictAddCommand.java

    r8910 r8914  
    6161    @Override
    6262    public void undoCommand() {
    63         if (Main.map != null && !Main.map.mapView.hasLayer(getLayer())) {
     63        if (Main.isDisplayingMapView() && !Main.map.mapView.hasLayer(getLayer())) {
    6464            Main.warn(tr("Layer ''{0}'' does not exist any more. Cannot remove conflict for object ''{1}''.",
    6565                    getLayer().getName(),
  • trunk/src/org/openstreetmap/josm/command/conflict/ConflictResolveCommand.java

    r8910 r8914  
    6868        super.undoCommand();
    6969
    70         if (!Main.map.mapView.hasLayer(getLayer())) {
    71             Main.warn(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more",
    72                     this.toString(),
    73                     getLayer().toString()
    74             ));
    75             return;
     70        if (Main.isDisplayingMapView()) {
     71            if (!Main.map.mapView.hasLayer(getLayer())) {
     72                Main.warn(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more",
     73                        this.toString(),
     74                        getLayer().toString()
     75                ));
     76                return;
     77            }
     78
     79            Main.map.mapView.setActiveLayer(getLayer());
    7680        }
    77 
    78         Main.map.mapView.setActiveLayer(getLayer());
    7981        reconstituteConflicts();
    8082    }
Note: See TracChangeset for help on using the changeset viewer.