From 197a8b99ee3b667c90c61d292d66fefaf074b690 Mon Sep 17 00:00:00 2001 From: Alberto Codutti Date: Mon, 18 Mar 2024 16:18:04 +0100 Subject: [PATCH] :bug: (commons): fixes resolution of CertificateQuery forwardable entities when predicates are null Signed-off-by: Alberto Codutti --- .../service/utils/internal/KapuaEntityQueryUtilImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/service/commons/utils/internal/src/main/java/org/eclipse/kapua/service/utils/internal/KapuaEntityQueryUtilImpl.java b/service/commons/utils/internal/src/main/java/org/eclipse/kapua/service/utils/internal/KapuaEntityQueryUtilImpl.java index 8308b62a28c..4ffb7fc799b 100644 --- a/service/commons/utils/internal/src/main/java/org/eclipse/kapua/service/utils/internal/KapuaEntityQueryUtilImpl.java +++ b/service/commons/utils/internal/src/main/java/org/eclipse/kapua/service/utils/internal/KapuaEntityQueryUtilImpl.java @@ -50,7 +50,9 @@ public KapuaQuery transformInheritedQuery(@NotNull KapuaForwardableEntityQuery q KapuaId scopeId = query.getScopeId(); // Replacement predicate root - AndPredicate newPred = query.andPredicate(query.getPredicate()); + AndPredicate newPred = query.getPredicate() != null ? + query.andPredicate(query.getPredicate()) : + query.andPredicate(); // Create predicate to query ancestor accounts for entities that are forwardable query.setScopeId(KapuaId.ANY);