am f60f29d0: am c9149984: Merge "Prevent NullPointerException in getStringValue if no value is set" into lmp-mr1-dev automerge: e832393
* commit 'f60f29d060a538bd59b79ab8bd69ca6a31d26c29':
Prevent NullPointerException in getStringValue if no value is set
diff --git a/core/java/android/bluetooth/BluetoothGattCharacteristic.java b/core/java/android/bluetooth/BluetoothGattCharacteristic.java
index a86677c..7cdcc2c 100644
--- a/core/java/android/bluetooth/BluetoothGattCharacteristic.java
+++ b/core/java/android/bluetooth/BluetoothGattCharacteristic.java
@@ -502,7 +502,7 @@
* @return Cached value of the characteristic
*/
public String getStringValue(int offset) {
- if (offset > mValue.length) return null;
+ if (mValue == null || offset > mValue.length) return null;
byte[] strBytes = new byte[mValue.length - offset];
for (int i=0; i != (mValue.length-offset); ++i) strBytes[i] = mValue[offset+i];
return new String(strBytes);