summaryrefslogtreecommitdiff
path: root/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
diff options
context:
space:
mode:
authorChen Chen <cncn@google.com>2022-03-14 13:16:44 -0700
committerChen Chen <cncn@google.com>2022-03-14 18:04:27 -0700
commit3b46c05d95a87da8d76a308a19fdf07ee7c76ae5 (patch)
tree812de35b62f94cd06f2c6018d043bbd6d9aaaccf /bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
parent5ee0d1534eaa4c06257ede39e11b9643a8003ba9 (diff)
SpatialAudio: fix crashes in BluetoothAudioSession
Bug: 224578221 Bug: 214615268 Test: build Change-Id: I0fd7e0887200e39dc996b0d84de421ec13897e94
Diffstat (limited to 'bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp')
-rw-r--r--bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
index 37ac9678e8..cdee520b11 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioSession.cpp
@@ -431,7 +431,9 @@ void BluetoothAudioSession::ReportLowLatencyModeAllowedChanged(bool allowed) {
std::shared_ptr<PortStatusCallbacks> callback = observer.second;
LOG(INFO) << __func__
<< " - allowed=" << (allowed ? " allowed" : " disallowed");
- callback->low_latency_mode_allowed_cb_(cookie, allowed);
+ if (callback->low_latency_mode_allowed_cb_ != nullptr) {
+ callback->low_latency_mode_allowed_cb_(cookie, allowed);
+ }
}
}