if (!sone.isPresent()) {
return createErrorJsonObject("invalid-sone-id");
}
- Sone currentSone = getCurrentSone(request.getToadletContext());
- if (currentSone == null) {
- return createErrorJsonObject("auth-required");
- }
+ Sone currentSone = getCurrentSone(request.getToadletContext()).get();
webInterface.getCore().followSone(currentSone, soneId);
webInterface.getCore().markSoneKnown(sone.get());
return createSuccessJsonObject();