forked from j62/ctbrec
Fix possible NPE in getStreamUrl
This commit is contained in:
parent
edb11a0efc
commit
72064eb55b
|
@ -538,8 +538,8 @@ public class MyFreeCamsClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getStreamUrl(SessionState state) {
|
public String getStreamUrl(SessionState state) {
|
||||||
Integer camserv = state.getU().getCamserv();
|
Integer camserv = Optional.ofNullable(state.getU()).map(u -> u.getCamserv()).orElse(-1);
|
||||||
if(camserv != null) {
|
if(camserv != null && camserv != -1) {
|
||||||
int userChannel = 100000000 + state.getUid();
|
int userChannel = 100000000 + state.getUid();
|
||||||
String streamUrl = "";
|
String streamUrl = "";
|
||||||
String phase = state.getU().getPhase() != null ? state.getU().getPhase() : "z";
|
String phase = state.getU().getPhase() != null ? state.getU().getPhase() : "z";
|
||||||
|
|
Loading…
Reference in New Issue