From 76e230918f83d6cb2a4bdbf43ea5b28edeccf848 Mon Sep 17 00:00:00 2001 From: Hugh Chen Date: Wed, 20 Apr 2022 03:45:13 +0000 Subject: [PATCH] Check null BT profile to prevent crash Bug: 229802811 Test: build pass Change-Id: Idf9f32ec08793784fbce05d34c53cdf53cddb312 --- .../settings/bluetooth/BluetoothDetailsProfilesController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java b/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java index f0809ad84be..b7f89095755 100644 --- a/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java +++ b/src/com/android/settings/bluetooth/BluetoothDetailsProfilesController.java @@ -479,7 +479,7 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll @Override protected void refresh() { for (LocalBluetoothProfile profile : getProfiles()) { - if (!profile.isProfileReady()) { + if (profile != null && !profile.isProfileReady()) { continue; } SwitchPreference pref = mProfilesContainer.findPreference(