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

Commit 22f1dcf5 authored by Martin Brabham's avatar Martin Brabham Committed by Myles Watson
Browse files

Fix NPE in logging

Bug: 191268917
Test: Manual test app, log OobData
Tag: #stability
Change-Id: I975722642298cb580081de9a324302d7a3282d3c
parent 4ebbeba9
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -937,17 +937,18 @@ public final class OobData implements Parcelable {
    }

    @NonNull
    private String toHexString(@NonNull int b) {
    private String toHexString(int b) {
        return toHexString(new byte[] {(byte) b});
    }

    @NonNull
    private String toHexString(@NonNull byte b) {
    private String toHexString(byte b) {
        return toHexString(new byte[] {b});
    }

    @NonNull
    private String toHexString(@NonNull byte[] array) {
    private String toHexString(byte[] array) {
        if (array == null) return "null";
        StringBuilder builder = new StringBuilder(array.length * 2);
        for (byte b: array) {
            builder.append(String.format("%02x", b));