Skip to content

Commit

Permalink
xds: Replace null check with has value check because proto fields can…
Browse files Browse the repository at this point in the history
… never be null. (#11675)
  • Loading branch information
kannanjgithub authored Nov 8, 2024
1 parent d6c8029 commit 5081e60
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 5081e60

Please sign in to comment.