From 6d333a43abc3d0f2bbd8135b41072ef942418051 Mon Sep 17 00:00:00 2001 From: RitikJain4108 <99730411+RitikJain4108@users.noreply.github.com> Date: Mon, 3 Jun 2024 14:07:54 +0530 Subject: [PATCH] [ES-558] Fixed 'EmptyResultDataAccessException' issue (#1280) * update code to publish event Signed-off-by: Ritik Jain (IN74108) * added property Signed-off-by: Ritik Jain (IN74108) * added property Signed-off-by: Ritik Jain (IN74108) * fix github build failure Signed-off-by: Ritik Jain (IN74108) * registered topic Signed-off-by: Ritik Jain (IN74108) * fixed application failed to start issue Signed-off-by: Ritik Jain (IN74108) * fixed EmptyResultDataAccessException issue Signed-off-by: Ritik Jain (IN74108) --------- Signed-off-by: Ritik Jain (IN74108) Co-authored-by: Ritik Jain (IN74108) Co-authored-by: 61074108 <61074108@5CD12778H4> --- .../service/impl/idevent/IdChangeEventHandlerServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/impl/idevent/IdChangeEventHandlerServiceImpl.java b/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/impl/idevent/IdChangeEventHandlerServiceImpl.java index c91749d4ccd..4c7a6c58dbb 100644 --- a/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/impl/idevent/IdChangeEventHandlerServiceImpl.java +++ b/authentication/authentication-common/src/main/java/io/mosip/authentication/common/service/impl/idevent/IdChangeEventHandlerServiceImpl.java @@ -187,7 +187,7 @@ private void handleRemoveId(EventModel eventModel) throws IdAuthenticationBusine Event event = eventModel.getEvent(); Map additionalData = event.getData(); String idHash = (String) additionalData.get(ID_HASH); - if (idHash != null && !idHash.isEmpty()) { + if (idHash != null && !idHash.isEmpty() && identityCacheRepo.existsById(idHash)) { identityCacheRepo.deleteById(idHash); removeIdStatusEventPublisher.publishRemoveIdStatusEvent(idHash); }