leaudio: Fix possible crash
Bug: 263411708
Test: atest BluetoothInstrumentationTests
Test: manual, connect leaudio set while streaming to other leaudio
Tag: #feature
Merged-In: I48d2d674f5febdd0af7227b342e26f2f45937c53
Change-Id: I48d2d674f5febdd0af7227b342e26f2f45937c53
(cherry picked from commit 344c42d1ea55da2d1920178fa57a0f76b250a09a)
diff --git a/system/bta/le_audio/client.cc b/system/bta/le_audio/client.cc
index 4664a26..aa48d3f 100644
--- a/system/bta/le_audio/client.cc
+++ b/system/bta/le_audio/client.cc
@@ -2337,6 +2337,11 @@
return;
}
+ if (!stream_conf->conf) {
+ LOG_INFO("Configuration not yet set. Nothing to do now");
+ return;
+ }
+
auto num_of_devices =
get_num_of_devices_in_configuration(stream_conf->conf);