From 6c5d4a0bca387d296f56f75253dc2e6feaaef6d8 Mon Sep 17 00:00:00 2001 From: James Willcox Date: Tue, 21 Feb 2023 14:56:51 +0000 Subject: [PATCH] Add a missing null check to BeginGetCredentialOption Bug: 262614389 Test: CTS Change-Id: I48f7932a0da4f941871eeebaa16955f3711931a8 --- .../android/service/credentials/BeginGetCredentialOption.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/java/android/service/credentials/BeginGetCredentialOption.java b/core/java/android/service/credentials/BeginGetCredentialOption.java index 81b9f22ebc7f0..1ad0424f44e34 100644 --- a/core/java/android/service/credentials/BeginGetCredentialOption.java +++ b/core/java/android/service/credentials/BeginGetCredentialOption.java @@ -116,12 +116,12 @@ public class BeginGetCredentialOption implements Parcelable { * @param id the unique id associated with this option * @param type the requested credential type * @param candidateQueryData the request candidateQueryData - * @throws IllegalArgumentException If type is empty. + * @throws IllegalArgumentException If id or type is empty. */ public BeginGetCredentialOption( @NonNull String id, @NonNull String type, @NonNull Bundle candidateQueryData) { - mId = id; + mId = Preconditions.checkStringNotEmpty(id, "id must not be empty"); mType = Preconditions.checkStringNotEmpty(type, "type must not be empty"); Bundle bundle = new Bundle(); bundle.putAll(candidateQueryData);