mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-07 20:22:27 +02:00
Fix WebRTCDataChannels crash
This commit is contained in:
parent
65dec6dfd8
commit
ff72b422b3
1 changed files with 7 additions and 1 deletions
|
@ -524,8 +524,14 @@ bool WebRTCDataChannels::sendDataMessage(int dataChannelID, const QByteArray& by
|
|||
|
||||
/// @brief Gets the number of bytes waiting to be written on a data channel.
|
||||
/// @param port The data channel ID.
|
||||
/// @return The number of bytes waiting to be written on the data channel.
|
||||
/// @return The number of bytes waiting to be written on the data channel; 0 if the channel doesn't exist.
|
||||
qint64 WebRTCDataChannels::getBufferedAmount(int dataChannelID) const {
|
||||
if (!_connectionsByDataChannel.contains(dataChannelID)) {
|
||||
#ifdef WEBRTC_DEBUG
|
||||
qCDebug(networking_webrtc) << "WebRTCDataChannels::getBufferedAmount() : Channel doesn't exist:" << dataChannelID;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
auto connection = _connectionsByDataChannel.value(dataChannelID);
|
||||
return connection->getBufferedAmount();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue