Make MFC client and getOnlineModels more robust
This commit is contained in:
parent
010c4a04cd
commit
882742ce3b
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue