Ignore:
Timestamp:
2013-12-22T12:27:11+01:00 (11 years ago)
Author:
donvip
Message:

[josm-plugins] global replacement of Main.map.mapview.getEditLayer() by Main.main.getEditLayer() (avoids NPEs)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/DownloadParentsAction.java

    r29535 r30145  
    3737        this.rel = rel;
    3838        rel.addChosenRelationListener(this);
    39         setEnabled(rel.get() != null && Main.map.mapView.getEditLayer() != null);
     39        setEnabled(rel.get() != null && Main.main.getEditLayer() != null);
    4040    }
    4141
     
    4646        objects.add(relation);
    4747        objects.addAll(relation.getMemberPrimitives());
    48         Main.worker.submit(new DownloadReferrersTask(Main.map.mapView.getEditLayer(), objects));
     48        Main.worker.submit(new DownloadReferrersTask(Main.main.getEditLayer(), objects));
    4949    }
    5050
    5151    public void chosenRelationChanged( Relation oldRelation, Relation newRelation ) {
    52         setEnabled(newRelation != null && Main.map.mapView.getEditLayer() != null);
     52        setEnabled(newRelation != null && Main.main.getEditLayer() != null);
    5353    }
    5454
    5555    protected void downloadMembers( Relation rel ) {
    5656        if( !rel.isNew() ) {
    57             Main.worker.submit(new DownloadRelationTask(Collections.singletonList(rel), Main.map.mapView.getEditLayer()));
     57            Main.worker.submit(new DownloadRelationTask(Collections.singletonList(rel), Main.main.getEditLayer()));
    5858        }
    5959    }
     
    6464        ret.addAll(rel.getIncompleteMembers());
    6565        if( ret.isEmpty() ) return;
    66         Main.worker.submit(new DownloadRelationMemberTask(Collections.singletonList(rel), ret, Main.map.mapView.getEditLayer()));
     66        Main.worker.submit(new DownloadRelationMemberTask(Collections.singletonList(rel), ret, Main.main.getEditLayer()));
    6767    }
    6868}
Note: See TracChangeset for help on using the changeset viewer.