Skip to content

Commit

Permalink
Replace null check with has value check because proto fields can neve…
Browse files Browse the repository at this point in the history
…r be null.
  • Loading branch information
kannanjgithub committed Nov 8, 2024
1 parent d6c8029 commit 62c2557
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xds/src/main/java/io/grpc/xds/GcpAuthenticationFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ public ConfigOrError<? extends FilterConfig> parseFilterConfig(Message rawProtoM

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(
Expand Down

0 comments on commit 62c2557

Please sign in to comment.