summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ajay Panicker <apanicke@google.com> 2016-09-23 12:39:43 -0700
committer Andre Eisenbach <eisenbach@google.com> 2016-09-23 22:08:26 +0000
commit74fa2d684612fbd75a827c64ef4d144cdccbc6ef (patch)
treea8c22ebdec2c293b7f7468ef3b07332963bd2d0a
parent824fc38439e65548db52a0e328b3787ad6362837 (diff)
Prevent NPE if someone creates a bad BluetoothHealthAppConfig object
Bug: 28271086 Change-Id: Ic8ebe3152e2b06c070316acc7e6a1f89763cd2a3
-rw-r--r--core/java/android/bluetooth/BluetoothHealthAppConfiguration.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/java/android/bluetooth/BluetoothHealthAppConfiguration.java b/core/java/android/bluetooth/BluetoothHealthAppConfiguration.java
index 15a9101452ed..1717a1e36e1f 100644
--- a/core/java/android/bluetooth/BluetoothHealthAppConfiguration.java
+++ b/core/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() &&