- if (!webInterface.getCore().hasSone(soneId)) {
- return new JsonObject().put("success", false).put("error", "invalid-sone-id");
- }
- Sone currentSone = getCurrentSone(request.getToadletContext());
- if (currentSone == null) {
- return new JsonObject().put("success", false).put("error", "auth-required");
+ if (!webInterface.getCore().getSone(soneId).isPresent()) {
+ return createErrorJsonObject("invalid-sone-id");