mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 03:59:35 +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() {
|
||||
|
||||
if (peerConnection != null) {
|
||||
for (IceCandidate iceCandidate : iceCandidates) {
|
||||
peerConnection.addIceCandidate(iceCandidate);
|
||||
}
|
||||
|
||||
iceCandidates = new ArrayList<>();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public MagicSdpObserver getMagicSdpObserver() {
|
||||
@ -124,12 +125,14 @@ public class MagicPeerConnectionWrapper {
|
||||
}
|
||||
|
||||
public void addCandidate(IceCandidate iceCandidate) {
|
||||
if (peerConnection != null) {
|
||||
if (peerConnection.getRemoteDescription() != null) {
|
||||
peerConnection.addIceCandidate(iceCandidate);
|
||||
} else {
|
||||
iceCandidates.add(iceCandidate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void sendChannelData(DataChannelMessage dataChannelMessage) {
|
||||
ByteBuffer buffer = null;
|
||||
@ -338,8 +341,10 @@ public class MagicPeerConnectionWrapper {
|
||||
|
||||
EventBus.getDefault().post(new SessionDescriptionSendEvent(sessionDescriptionWithPreferredCodec, sessionId,
|
||||
sessionDescription.type.canonicalForm().toLowerCase(), null));
|
||||
if (peerConnection != null) {
|
||||
peerConnection.setLocalDescription(magicSdpObserver, sessionDescriptionWithPreferredCodec);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetSuccess() {
|
||||
|
Loading…
Reference in New Issue
Block a user