xds: Replace null check with has value check because proto fields can never be null. (#11675)

This commit is contained in:
Kannan J 2024-11-08 13:17:24 +05:30 committed by GitHub
parent d6c80294a7
commit 5081e60626
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -72,8 +72,8 @@ final class GcpAuthenticationFilter implements Filter, ClientInterceptorBuilder
long cacheSize = 10;
// Validate cache_config
TokenCacheConfig cacheConfig = gcpAuthnProto.getCacheConfig();
if (cacheConfig != null) {
if (gcpAuthnProto.hasCacheConfig()) {
TokenCacheConfig cacheConfig = gcpAuthnProto.getCacheConfig();
cacheSize = cacheConfig.getCacheSize().getValue();
if (cacheSize == 0) {
return ConfigOrError.fromError(