From 2e8a0aff66e8501eb5a425b8bfea92ef0dbdc80c Mon Sep 17 00:00:00 2001 From: Ajay Panicker Date: Fri, 23 Sep 2016 12:39:43 -0700 Subject: Prevent NPE if someone creates a bad BluetoothHealthAppConfig object Bug: 28271086 Change-Id: Ic8ebe3152e2b06c070316acc7e6a1f89763cd2a3 --- framework/java/android/bluetooth/BluetoothHealthAppConfiguration.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'framework/java/android/bluetooth/BluetoothHealthAppConfiguration.java') diff --git a/framework/java/android/bluetooth/BluetoothHealthAppConfiguration.java b/framework/java/android/bluetooth/BluetoothHealthAppConfiguration.java index 15a9101452..1717a1e36e 100644 --- a/framework/java/android/bluetooth/BluetoothHealthAppConfiguration.java +++ b/framework/java/android/bluetooth/BluetoothHealthAppConfiguration.java @@ -68,7 +68,9 @@ public final class BluetoothHealthAppConfiguration implements Parcelable { public boolean equals(Object o) { if (o instanceof BluetoothHealthAppConfiguration) { BluetoothHealthAppConfiguration config = (BluetoothHealthAppConfiguration) o; - // config.getName() can never be NULL + + if (mName == null) return false; + return mName.equals(config.getName()) && mDataType == config.getDataType() && mRole == config.getRole() && -- cgit v1.2.3