diff options
author | leventecsanyi <levente.csanyi@est.tech> | 2024-02-05 11:19:34 +0100 |
---|---|---|
committer | leventecsanyi <levente.csanyi@est.tech> | 2024-02-05 11:42:55 +0100 |
commit | e1cddc550e45890553de478a9c07fa424aa3811b (patch) | |
tree | abb42f6aa02a4024c6541dd8ab8af4f0e0b9b101 | |
parent | c45db42e7fca53873282aa8f4cff533ef1bdc0de (diff) |
CmHandle delete is failing with InternalServerError: Null key is not allowed
- added null check to alt id removal from cache
Issue-ID: CPS-2064
Change-Id: Iee484b96f505106613ce2d646898ca7ee3873f28
Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
-rw-r--r-- | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/CmHandleIdMapper.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/CmHandleIdMapper.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/CmHandleIdMapper.java index 8175fb5e74..a88adbd110 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/CmHandleIdMapper.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/CmHandleIdMapper.java @@ -73,7 +73,13 @@ public class CmHandleIdMapper { public void removeMapping(final String cmHandleId) { final String alternateId = alternateIdPerCmHandleId.remove(cmHandleId); - cmHandleIdPerAlternateId.remove(alternateId); + removeAlternateIdWithValidation(alternateId); + } + + private void removeAlternateIdWithValidation(final String alternateId) { + if (alternateId != null) { + cmHandleIdPerAlternateId.remove(alternateId); + } } private void initializeCache() { |