Changeset 18005 in josm for trunk/src/org
- Timestamp:
- 2021-07-12T12:42:05+02:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r17786 r18005 39 39 import org.openstreetmap.josm.gui.layer.Layer; 40 40 import org.openstreetmap.josm.spi.preferences.Config; 41 import org.openstreetmap.josm.tools.Logging;42 41 import org.openstreetmap.josm.tools.Shortcut; 43 42 … … 289 288 return null; 290 289 } 291 try { 292 List<Layer> layers = LayerListDialog.getInstance().getModel().getSelectedLayers(); 293 if (!layers.isEmpty()) 294 return layers.get(0); 295 } catch (IllegalStateException e) { 296 Logging.error(e); 297 } 298 return null; 290 List<Layer> layers = LayerListDialog.getInstance().getModel().getSelectedLayers(); 291 return layers.isEmpty() ? null : layers.get(0); 299 292 } 300 293 … … 403 396 break; 404 397 case LAYER: 405 setEnabled( getFirstSelectedLayer() != null);398 setEnabled(map != null && getFirstSelectedLayer() != null); 406 399 break; 407 400 case CONFLICT:
Note:
See TracChangeset
for help on using the changeset viewer.