mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
Safeguards against null
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
02c115d49b
commit
f1d89ccacb
@ -111,12 +111,13 @@ public class MagicPeerConnectionWrapper {
|
|||||||
|
|
||||||
public void drainIceCandidates() {
|
public void drainIceCandidates() {
|
||||||
|
|
||||||
for (IceCandidate iceCandidate : iceCandidates) {
|
if (peerConnection != null) {
|
||||||
peerConnection.addIceCandidate(iceCandidate);
|
for (IceCandidate iceCandidate : iceCandidates) {
|
||||||
|
peerConnection.addIceCandidate(iceCandidate);
|
||||||
|
}
|
||||||
|
|
||||||
|
iceCandidates = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
iceCandidates = new ArrayList<>();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MagicSdpObserver getMagicSdpObserver() {
|
public MagicSdpObserver getMagicSdpObserver() {
|
||||||
@ -124,10 +125,12 @@ public class MagicPeerConnectionWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addCandidate(IceCandidate iceCandidate) {
|
public void addCandidate(IceCandidate iceCandidate) {
|
||||||
if (peerConnection.getRemoteDescription() != null) {
|
if (peerConnection != null) {
|
||||||
peerConnection.addIceCandidate(iceCandidate);
|
if (peerConnection.getRemoteDescription() != null) {
|
||||||
} else {
|
peerConnection.addIceCandidate(iceCandidate);
|
||||||
iceCandidates.add(iceCandidate);
|
} else {
|
||||||
|
iceCandidates.add(iceCandidate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -338,7 +341,9 @@ public class MagicPeerConnectionWrapper {
|
|||||||
|
|
||||||
EventBus.getDefault().post(new SessionDescriptionSendEvent(sessionDescriptionWithPreferredCodec, sessionId,
|
EventBus.getDefault().post(new SessionDescriptionSendEvent(sessionDescriptionWithPreferredCodec, sessionId,
|
||||||
sessionDescription.type.canonicalForm().toLowerCase(), null));
|
sessionDescription.type.canonicalForm().toLowerCase(), null));
|
||||||
peerConnection.setLocalDescription(magicSdpObserver, sessionDescriptionWithPreferredCodec);
|
if (peerConnection != null) {
|
||||||
|
peerConnection.setLocalDescription(magicSdpObserver, sessionDescriptionWithPreferredCodec);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user