- Sone sone = webInterface.core().getSone(soneId);
- if (sone == null) {
- return new JsonObject().put("success", false).put("error", "invalid-sone-id");
+ if (!webInterface.getCore().getSone(soneId).isPresent()) {
+ return createErrorJsonObject("invalid-sone-id");