audio: Fix possible NullPointerException when DEBUG is true

test: manual
sponsor: jpawlowski

Change-Id: I8b35a45ec1e984d8f63c5b11248d6dbfed077453
This commit is contained in:
Łukasz Rymanowski
2021-08-31 12:39:39 +00:00
parent f1245786d6
commit 7cddc6a227

View File

@@ -344,10 +344,19 @@ class BluetoothRouteProvider {
}
private void addActiveRoute(BluetoothRouteInfo btRoute) {
if (btRoute == null) {
if (DEBUG) {
Log.d(TAG, " btRoute is null");
}
return;
}
if (DEBUG) {
Log.d(TAG, "Adding active route: " + btRoute.route);
}
if (btRoute == null || mActiveRoutes.contains(btRoute)) {
if (mActiveRoutes.contains(btRoute)) {
if (DEBUG) {
Log.d(TAG, " btRoute is already added.");
}
return;
}
setRouteConnectionState(btRoute, STATE_CONNECTED);