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

Commit 74b1dd97 authored by Cole Faust's avatar Cole Faust
Browse files

Use Option.ofNullable instead of Optional.of

Optional.of expects a non-null value, and throws a
NullPointerException if it gets null.

This needs to be fixed to upgrade errorprone to v3.8.1.

Bug: 190944875
Test: Presubmits
Change-Id: I38b5d80ec8c1e2dc93d76e08a0d0051fc4127ab3
parent e9828780
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ public final class SpeedDialEntryDatabaseHelper extends SQLiteOpenHelper
              Channel.builder()
                  .setNumber(number)
                  .setPhoneType(cursor.getInt(POSITION_PHONE_TYPE))
                  .setLabel(Optional.of(cursor.getString(POSITION_PHONE_LABEL)).or(""))
                  .setLabel(Optional.fromNullable(cursor.getString(POSITION_PHONE_LABEL)).or(""))
                  .setTechnology(cursor.getInt(POSITION_PHONE_TECHNOLOGY))
                  .build();
        }