- Reply reply = webInterface.getCore().getReply(id);
- Set<Sone> sones = webInterface.getCore().getLikes(reply);
- return new JsonObject().put("success", true).put("likes", sones.size()).put("sones", getSones(sones));
+ Optional<PostReply> reply = webInterface.getCore().getPostReply(id);
+ if (!reply.isPresent()) {
+ return createErrorJsonObject("invalid-reply-id");
+ }
+ Set<Sone> sones = webInterface.getCore().getLikes(reply.get());
+ return createSuccessJsonObject().put("likes", sones.size()).put("sones", getSones(sones));