From fd9574cc5342d744fdebd1966c7a5d316280c471 Mon Sep 17 00:00:00 2001 From: Tharsanan1 Date: Thu, 26 Sep 2024 15:22:04 +0530 Subject: [PATCH] Fix nullpointer error --- .../java/org/wso2/apk/enforcer/grpc/ExtAuthService.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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.