From 4c5c0b98af9bac70b63853b138e91e54888f44cf Mon Sep 17 00:00:00 2001 From: Mohd Kaif Siddique Date: Tue, 23 Jul 2024 17:01:10 +0530 Subject: [PATCH] added check for trustFrameworkCriteria not null Signed-off-by: Mohd Kaif Siddique --- .../plugin/mock/service/MockAuthenticationService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mock-plugin/src/main/java/io/mosip/esignet/plugin/mock/service/MockAuthenticationService.java b/mock-plugin/src/main/java/io/mosip/esignet/plugin/mock/service/MockAuthenticationService.java index 068d6dc..718c934 100644 --- a/mock-plugin/src/main/java/io/mosip/esignet/plugin/mock/service/MockAuthenticationService.java +++ b/mock-plugin/src/main/java/io/mosip/esignet/plugin/mock/service/MockAuthenticationService.java @@ -223,13 +223,13 @@ private VerifiedKycExchangeRequestDto buildVerifiedKycExchangeRequestDto(Verifie int maxAge = filterDateTime != null ? filterDateTime.getMax_age() : 999; // Default value for maxAge if not set - if(!StringUtils.isEmpty(trustFrameworkCriteria.getValue())){ + if(trustFrameworkCriteria!=null && !StringUtils.isEmpty(trustFrameworkCriteria.getValue())){ trustFrameWorkMap.computeIfAbsent(trustFrameworkCriteria.getValue(), k -> new ArrayList<>()).add(new AbstractMap.SimpleEntry<>(claimName, maxAge)); - } else if (trustFrameworkCriteria.getValues()!=null && !trustFrameworkCriteria.getValues().isEmpty()) { + }else if (trustFrameworkCriteria!=null && trustFrameworkCriteria.getValues()!=null && !trustFrameworkCriteria.getValues().isEmpty()) { for (String trustFramework : trustFrameworkCriteria.getValues()) { trustFrameWorkMap.computeIfAbsent(trustFramework, list -> new ArrayList<>()).add(new AbstractMap.SimpleEntry<>(claimName, maxAge)); } - } else { + }else{ // Handle null trust_framework separately trustFrameWorkMap.computeIfAbsent(null, list -> new ArrayList<>()).add(new AbstractMap.SimpleEntry<>(claimName, maxAge)); }