- Sone sone = webInterface.getCore().getLocalSone(soneId, false);
- if (sone != null) {
- webInterface.getCore().unlockSone(sone);
+ Optional<LocalSone> localSone = webInterface.getCore().getLocalSone(soneId);
+ if (localSone.isPresent()) {
+ webInterface.getCore().unlockSone(localSone.get());