Skip to content
Snippets Groups Projects
Commit 566b354d authored by Lyubomir Marinov's avatar Lyubomir Marinov
Browse files

Fixes a NullPointerException during video conference calls. Reported by Emil Ivov.

parent ffd50d1a
No related branches found
No related tags found
No related merge requests found
...@@ -2062,16 +2062,21 @@ private Iterable<SendStream> stopSendStreams( ...@@ -2062,16 +2062,21 @@ private Iterable<SendStream> stopSendStreams(
return null; return null;
for (SendStream sendStream : sendStreams) for (SendStream sendStream : sendStreams)
{
try try
{ {
if(logger.isTraceEnabled()) if (logger.isTraceEnabled())
logger.trace("Stopping send stream with hashcode " {
+ sendStream.hashCode()); logger.trace(
"Stopping send stream with hashcode "
+ sendStream.hashCode());
}
sendStream.getDataSource().stop(); sendStream.getDataSource().stop();
sendStream.stop(); sendStream.stop();
if (close) if (close)
{
try try
{ {
sendStream.close(); sendStream.close();
...@@ -2089,16 +2094,17 @@ private Iterable<SendStream> stopSendStreams( ...@@ -2089,16 +2094,17 @@ private Iterable<SendStream> stopSendStreams(
* SendStreams, ignore the exception here just in case * SendStreams, ignore the exception here just in case
* because we already ignore IOExceptions. * because we already ignore IOExceptions.
*/ */
logger logger.error(
.error( "Failed to close send stream " + sendStream,
"Failed to close stream " + sendStream,
npe); npe);
} }
}
} }
catch (IOException ioe) catch (IOException ioe)
{ {
logger.warn("Failed to stop stream " + sendStream, ioe); logger.warn("Failed to stop send stream " + sendStream, ioe);
} }
}
return sendStreams; return sendStreams;
} }
......
...@@ -155,6 +155,15 @@ private synchronized void closeFakeSendStreamIfNotNecessary() ...@@ -155,6 +155,15 @@ private synchronized void closeFakeSendStreamIfNotNecessary()
{ {
fakeSendStream.close(); fakeSendStream.close();
} }
catch (NullPointerException npe)
{
/*
* Refer to MediaStreamImpl#stopSendStreams(
* Iterable<SendStream>, boolean) for an explanation about
* the swallowing of the exception.
*/
logger.error("Failed to close fake send stream", npe);
}
finally finally
{ {
fakeSendStream = null; fakeSendStream = null;
...@@ -180,7 +189,21 @@ private synchronized void closeSendStream(SendStreamDesc sendStreamDesc) ...@@ -180,7 +189,21 @@ private synchronized void closeSendStream(SendStreamDesc sendStreamDesc)
if (sendStreams.contains(sendStreamDesc) if (sendStreams.contains(sendStreamDesc)
&& (sendStreamDesc.getSendStreamCount() < 1)) && (sendStreamDesc.getSendStreamCount() < 1))
{ {
sendStreamDesc.sendStream.close(); SendStream sendStream = sendStreamDesc.sendStream;
try
{
sendStream.close();
}
catch (NullPointerException npe)
{
/*
* Refer to MediaStreamImpl#stopSendStreams(
* Iterable<SendStream>, boolean) for an explanation about the
* swallowing of the exception.
*/
logger.error("Failed to close send stream", npe);
}
sendStreams.remove(sendStreamDesc); sendStreams.remove(sendStreamDesc);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment