Skip to content

Commit

Permalink
Fixed NPE in AudioProcessingConfig when no NS level was set
Browse files Browse the repository at this point in the history
  • Loading branch information
devopvoid committed Nov 23, 2021
1 parent 73df466 commit 81164ef
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ namespace jni
config.level_estimation.enabled = levelEstimation.getBoolean(javaLevelEstimationClass->enabled);

config.noise_suppression.enabled = noiseSuppression.getBoolean(javaNoiseSuppressionClass->enabled);
config.noise_suppression.level = jni::JavaEnums::toNative<webrtc::AudioProcessing::Config::NoiseSuppression::Level>(env, noiseSuppression.getObject(javaNoiseSuppressionClass->level));

JavaLocalRef<jobject> nsLevel = noiseSuppression.getObject(javaNoiseSuppressionClass->level);

if (nsLevel.get()) {
config.noise_suppression.level = jni::JavaEnums::toNative<webrtc::AudioProcessing::Config::NoiseSuppression::Level>(env, nsLevel);
}

config.residual_echo_detector.enabled = residualEchoDetector.getBoolean(javaResidualEchoDetectorClass->enabled);

Expand Down

0 comments on commit 81164ef

Please sign in to comment.