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

Commit d3d26f04 authored by Felipe Leme's avatar Felipe Leme Committed by android-build-merger
Browse files

Merge "Fixed AutofillServiceHelper.assertValid() so it throws the right...

Merge "Fixed AutofillServiceHelper.assertValid() so it throws the right exception." into pi-dev am: 0049ec14
am: abd29040

Change-Id: I33538ef226c81fc380fb21f198353f1cde86bfd3
parents 5593fd4c abd29040
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -26,7 +26,13 @@ final class AutofillServiceHelper {

    static AutofillId[] assertValid(@Nullable AutofillId[] ids) {
        Preconditions.checkArgument(ids != null && ids.length > 0, "must have at least one id");
        return Preconditions.checkArrayElementsNotNull(ids, "ids");
        // Can't use Preconditions.checkArrayElementsNotNull() because it throws NPE instead of IAE
        for (int i = 0; i < ids.length; ++i) {
            if (ids[i] == null) {
                throw new IllegalArgumentException("ids[" + i + "] must not be null");
            }
        }
        return ids;
    }

    private AutofillServiceHelper() {