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/surveyor/src/at/dallermassl/josm/plugin/surveyor/AutoSaveEditLayerTimerTask.java

    r27243 r30145  
    3232    }
    3333
    34     /* (non-Javadoc)
    35      * @see java.util.TimerTask#run()
    36      */
    3734    @Override
    3835    public void run() {
    39         if(Main.map == null || Main.map.mapView == null || Main.map.mapView.getEditLayer() == null) {
     36        OsmDataLayer layer = Main.main.getEditLayer();
     37        if (layer == null) {
    4038            return;
    4139        }
    42         OsmDataLayer layer = Main.map.mapView.getEditLayer();
    4340        try {
    4441            DataSet dataset = layer.data;
    45 
    46 //            File outFile = layer.associatedFile;
    47 //            if(outFile == null) {
    48 //                outFile = file;
    49 //            }
    5042
    5143            // write to temporary file, on success, rename tmp file to target file:
     
    6961        }
    7062    }
    71 
    72 
    7363}
Note: See TracChangeset for help on using the changeset viewer.