diff --git a/common/src/main/java/ctbrec/recorder/NextGenLocalRecorder.java b/common/src/main/java/ctbrec/recorder/NextGenLocalRecorder.java index 7d2122c9..c2d94fa0 100644 --- a/common/src/main/java/ctbrec/recorder/NextGenLocalRecorder.java +++ b/common/src/main/java/ctbrec/recorder/NextGenLocalRecorder.java @@ -555,11 +555,11 @@ public class NextGenLocalRecorder implements Recorder { return getModels().stream().filter(m -> { try { return m.isOnline(); - } catch (IOException | ExecutionException e) { - return false; } catch (InterruptedException e) { Thread.currentThread().interrupt(); return false; + } catch (Exception e) { + return false; } }).collect(Collectors.toList()); } diff --git a/common/src/main/java/ctbrec/sites/mfc/ServerConfig.java b/common/src/main/java/ctbrec/sites/mfc/ServerConfig.java index 96c7fd65..52019d44 100644 --- a/common/src/main/java/ctbrec/sites/mfc/ServerConfig.java +++ b/common/src/main/java/ctbrec/sites/mfc/ServerConfig.java @@ -8,6 +8,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Optional; import org.json.JSONArray; import org.json.JSONObject; @@ -86,7 +87,7 @@ public class ServerConfig { } public boolean isOnWzObsVideoServer(SessionState state) { - int camserv = Objects.requireNonNull(Objects.requireNonNull(state.getU()).getCamserv()); + int camserv = Optional.ofNullable(state).map(SessionState::getU).map(User::getCamserv).orElse(-1); return wzobsServers.containsKey(Integer.toString(camserv)); }