Changeset 9629 in josm for trunk/src/org


Ignore:
Timestamp:
2016-01-25T13:02:39+01:00 (9 years ago)
Author:
bastiK
Message:

applied #12442 - fix: save session as caused NPE when there were no layers (patch by kolesar)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java

    r9173 r9629  
    3535import org.openstreetmap.josm.gui.ExtendedDialog;
    3636import org.openstreetmap.josm.gui.HelpAwareOptionPane;
     37import org.openstreetmap.josm.gui.MapFrame;
     38import org.openstreetmap.josm.gui.MapFrameListener;
    3739import org.openstreetmap.josm.gui.layer.Layer;
    3840import org.openstreetmap.josm.gui.widgets.AbstractFileChooser;
     
    4951 * @since 4685
    5052 */
    51 public class SessionSaveAsAction extends DiskAccessAction {
     53public class SessionSaveAsAction extends DiskAccessAction implements MapFrameListener {
    5254
    5355    private transient List<Layer> layers;
     
    7173                null, toolbar, "save_as-session", installAdapters);
    7274        putValue("help", ht("/Action/SessionSaveAs"));
     75        Main.addMapFrameListener(this);
    7376    }
    7477
     
    284287        setEnabled(Main.isDisplayingMapView());
    285288    }
     289
     290    @Override
     291    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
     292        updateEnabledState();
     293    };
    286294}
Note: See TracChangeset for help on using the changeset viewer.