- Reply reply = webInterface.getCore().getReply(replyId);
- Sone currentSone = getCurrentSone(request.getToadletContext());
- if (reply == null) {
- return new JsonObject().put("success", false).put("error", "invalid-reply-id");
- }
- if (currentSone == null) {
- return new JsonObject().put("success", false).put("error", "auth-required");
+ Optional<PostReply> reply = webInterface.getCore().getPostReply(replyId);
+ if (!reply.isPresent()) {
+ return createErrorJsonObject("invalid-reply-id");