- Sone currentSone = getCurrentSone(request.getToadletContext());
- Sone sone = webInterface.getCore().getSone(identity, false);
- if (sone != null) {
- webInterface.getCore().trustSone(currentSone, sone);
+ Sone currentSone = getCurrentSone(request.getToadletContext()).get();
+ Optional<Sone> sone = webInterface.getCore().getSone(identity);
+ if (sone.isPresent()) {
+ webInterface.getCore().trustSone(currentSone, sone.get());