diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/ExtAuthService.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/ExtAuthService.java index 060a441b0..e582beafe 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/ExtAuthService.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/grpc/ExtAuthService.java @@ -191,8 +191,11 @@ private CheckResponse buildResponse(CheckRequest request, ResponseObject respons Struct.Builder structBuilder = Struct.newBuilder(); if (responseObject.getMetaDataMap() != null) { - responseObject.getMetaDataMap().forEach((key, value) -> - addMetadata(structBuilder, key, value)); + responseObject.getMetaDataMap().forEach((key, value) -> { + if (value != null) { + addMetadata(structBuilder, key, value); + } + }); } //Adds original request path header without params as a metadata for access logging.