File tree Expand file tree Collapse file tree
google-auth-library-java/oauth2_http/java/com/google/auth/oauth2 Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments