Skip to content

Commit 5473d28

Browse files
chore: Update google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/UserAuthorizer.java
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 04d869c commit 5473d28

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/UserAuthorizer.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -671,19 +671,21 @@ public Builder setHttpTransportFactory(HttpTransportFactory transportFactory) {
671671
* @return this {@code Builder} object
672672
*/
673673
@CanIgnoreReturnValue
674-
public Builder setPKCEProvider(PKCEProvider pkce) {
675-
Preconditions.checkNotNull(pkce);
676-
if (pkce.getCodeChallenge() == null
677-
|| pkce.getCodeVerifier() == null
678-
|| pkce.getCodeChallengeMethod() == null) {
679-
680-
throw new IllegalArgumentException(
681-
"PKCE provider contained null implementations. PKCE object must implement all"
682-
+ " PKCEProvider methods.");
674+
public Builder setPKCEProvider(@Nullable PKCEProvider pkce) {
675+
if (pkce != null) {
676+
if (pkce.getCodeChallenge() == null
677+
|| pkce.getCodeVerifier() == null
678+
|| pkce.getCodeChallengeMethod() == null) {
679+
680+
throw new IllegalArgumentException(
681+
"PKCE provider contained null implementations. PKCE object must implement all"
682+
+ " PKCEProvider methods.");
683+
}
683684
}
684685
this.pkce = pkce;
685686
return this;
686687
}
688+
}
687689

688690
/**
689691
* Sets the optional {@link ClientAuthenticationType}, one of the client authentication methods

0 commit comments

Comments
 (0)