Resolved issue with throwing a runtime exception when the state monitor

was null.
This commit is contained in:
denny
2015-12-31 09:40:20 -05:00
parent 712ef0666e
commit c82fc54fbd

View File

@@ -180,7 +180,7 @@ public class ChannelState extends Module implements ICallEventProvider,
{
if( mMonitoring.compareAndSet( false, true ) )
{
if( mRunningMonitor == null )
if( mRunningMonitor == null && mStateMonitor != null )
{
mRunningMonitor = mThreadPoolManager.scheduleFixedRate(
ThreadType.DECODER, mStateMonitor, 20, TimeUnit.MILLISECONDS );
@@ -205,11 +205,6 @@ public class ChannelState extends Module implements ICallEventProvider,
{
mThreadPoolManager.cancel( mRunningMonitor );
}
else
{
throw new RuntimeException( "Channel state monitor's scheduled "
+ "future pointer was null when trying to stop the monitor" );
}
mRunningMonitor = null;
}