return;
Layer layer = layers.get(0);
// Second condition excludes unnecessary UI call
if (layer.getMap() == getMap()
&& getMap().getEditManager().getSelectedLayer() != layer) {
SelectLayerCommand selectLayerCommand = new SelectLayerCommand(layer);
selectLayerCommand.setMap(getMap());
try {
selectLayerCommand.run(ProgressManager.instance().get());
} catch (Exception e) {
throw (RuntimeException) new RuntimeException().initCause(e);
}
getMap().sendCommandSync(new UndoRedoCommand(selectLayerCommand));
}