Skip to content

Commit 5081e60

Browse files
xds: Replace null check with has value check because proto fields can never be null. (grpc#11675)
1 parent d6c8029 commit 5081e60

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

xds/src/main/java/io/grpc/xds/GcpAuthenticationFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ public ConfigOrError<? extends FilterConfig> parseFilterConfig(Message rawProtoM
7272

7373
long cacheSize = 10;
7474
// Validate cache_config
75-
TokenCacheConfig cacheConfig = gcpAuthnProto.getCacheConfig();
76-
if (cacheConfig != null) {
75+
if (gcpAuthnProto.hasCacheConfig()) {
76+
TokenCacheConfig cacheConfig = gcpAuthnProto.getCacheConfig();
7777
cacheSize = cacheConfig.getCacheSize().getValue();
7878
if (cacheSize == 0) {
7979
return ConfigOrError.fromError(

0 commit comments

Comments
 (0)