diff --git a/sdk/android/src/java/org/webrtc/audio/WebRtcAudioRecord.java b/sdk/android/src/java/org/webrtc/audio/WebRtcAudioRecord.java index 42570d80e4..b7b78f731f 100644 --- a/sdk/android/src/java/org/webrtc/audio/WebRtcAudioRecord.java +++ b/sdk/android/src/java/org/webrtc/audio/WebRtcAudioRecord.java @@ -426,6 +426,9 @@ class WebRtcAudioRecord { Logging.w(TAG, "AudioManager#getActiveRecordingConfigurations() requires N or higher"); return 0; } + if (audioRecord == null) { + return 0; + } // Get a list of the currently active audio recording configurations of the device (can be more // than one). An empty list indicates there is no recording active when queried. List configs = audioManager.getActiveRecordingConfigurations();