- Sone selectedSone = null;
- for (Sone sone : webInterface.core().getSones()) {
- if (sone.getId().equals(soneId)) {
- selectedSone = sone;
- break;
+ Optional<LocalSone> selectedSone = webInterface.getCore().getLocalSone(soneId);
+ if (selectedSone.isPresent()) {
+ setCurrentSone(request.getToadletContext(), selectedSone.get());
+ String target = request.getHttpRequest().getParam("target");
+ if ((target == null) || (target.length() == 0)) {
+ target = "index.html";