forked from j62/ctbrec
1
0
Fork 0

Fix NPE in MFC client

This commit is contained in:
0xboobface 2020-05-23 16:20:49 +02:00
parent f1a0e5900c
commit 0858941b50
1 changed files with 1 additions and 1 deletions

View File

@ -608,7 +608,7 @@ public class MyFreeCamsClient {
public String getStreamUrl(SessionState state) { public String getStreamUrl(SessionState state) {
int userChannel = 100000000 + state.getUid(); int userChannel = 100000000 + state.getUid();
String phase = state.getU().getPhase() != null ? state.getU().getPhase() : "z"; String phase = Optional.ofNullable(state).map(SessionState::getU).map(User::getPhase).orElse("z");
String phasePrefix = phase.equals("z") ? "" : '_' + phase; String phasePrefix = phase.equals("z") ? "" : '_' + phase;
String server = "video" + getCamServ(state).replaceAll("^\\D+", ""); String server = "video" + getCamServ(state).replaceAll("^\\D+", "");
String nonce = Double.toString(Math.random()); String nonce = Double.toString(Math.random());