Skip to content

Commit

Permalink
Check activeRemote is non-null during handleWiredHeadsetChange()
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrune-signal committed Feb 14, 2020
1 parent 9fbc50d commit eeece55
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,11 @@ private void handleBluetoothChange(Intent intent) {
private void handleWiredHeadsetChange(Intent intent) {
Log.i(TAG, "handleWiredHeadsetChange...");

if (activePeer.getState() == CallState.CONNECTED ||
activePeer.getState() == CallState.DIALING ||
activePeer.getState() == CallState.RECEIVED_BUSY ||
activePeer.getState() == CallState.REMOTE_RINGING)
if ((activePeer != null) &&
(activePeer.getState() == CallState.CONNECTED ||
activePeer.getState() == CallState.DIALING ||
activePeer.getState() == CallState.RECEIVED_BUSY ||
activePeer.getState() == CallState.REMOTE_RINGING))
{
AudioManager audioManager = ServiceUtil.getAudioManager(this);
boolean present = intent.getBooleanExtra(EXTRA_AVAILABLE, false);
Expand All @@ -536,9 +537,7 @@ private void handleWiredHeadsetChange(Intent intent) {
audioManager.setSpeakerphoneOn(true);
}

if (activePeer != null) {
sendMessage(viewModelStateFor(activePeer), activePeer, localCameraState, remoteVideoEnabled, bluetoothAvailable, microphoneEnabled);
}
sendMessage(viewModelStateFor(activePeer), activePeer, localCameraState, remoteVideoEnabled, bluetoothAvailable, microphoneEnabled);
}
}

Expand Down

0 comments on commit eeece55

Please sign in to comment.