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

Commit f0ca90dc authored by Andre Eisenbach's avatar Andre Eisenbach Committed by android-build-merger
Browse files

am c9149984: Merge "Prevent NullPointerException in getStringValue if no value...

am c9149984: Merge "Prevent NullPointerException in getStringValue if no value is set" into lmp-mr1-dev
automerge: e832393

* commit 'e8323934c7dd01228b6550ac5dcad08999371a61':
  Prevent NullPointerException in getStringValue if no value is set
parents 46ab8f95 a86bfff2
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);