mirror of
https://github.com/nextcloud/talk-android
synced 2025-01-31 03:22:03 +00:00
Rewrite method to return early
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
parent
c222e01095
commit
bcd3893e7d
@ -286,13 +286,15 @@ public class PeerConnectionWrapper {
|
|||||||
*/
|
*/
|
||||||
public void send(DataChannelMessage dataChannelMessage) {
|
public void send(DataChannelMessage dataChannelMessage) {
|
||||||
DataChannel statusDataChannel = dataChannels.get("status");
|
DataChannel statusDataChannel = dataChannels.get("status");
|
||||||
if (statusDataChannel != null && dataChannelMessage != null) {
|
if (statusDataChannel == null || dataChannelMessage == null) {
|
||||||
try {
|
return;
|
||||||
ByteBuffer buffer = ByteBuffer.wrap(LoganSquare.serialize(dataChannelMessage).getBytes());
|
}
|
||||||
statusDataChannel.send(new DataChannel.Buffer(buffer, false));
|
|
||||||
} catch (Exception e) {
|
try {
|
||||||
Log.d(TAG, "Failed to send channel data, attempting regular " + dataChannelMessage);
|
ByteBuffer buffer = ByteBuffer.wrap(LoganSquare.serialize(dataChannelMessage).getBytes());
|
||||||
}
|
statusDataChannel.send(new DataChannel.Buffer(buffer, false));
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.d(TAG, "Failed to send channel data, attempting regular " + dataChannelMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user