Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a86bfff2 authored by Andre Eisenbach's avatar Andre Eisenbach
Browse files

Prevent NullPointerException in getStringValue if no value is set

Bug: 18686365
Change-Id: I5f5d07ef49500e0d8118ba04aaf373ae4514f034
parent 5a20b7c3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -502,7 +502,7 @@ public class BluetoothGattCharacteristic {
     * @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);