You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by jk...@apache.org on 2023/02/09 17:06:06 UTC

[unomi] branch UNOMI-689 created (now fac864e03)

This is an automated email from the ASF dual-hosted git repository.

jkevan pushed a change to branch UNOMI-689
in repository https://gitbox.apache.org/repos/asf/unomi.git


      at fac864e03 UNOMI-689: avoid load(null) to crash Exceptions

This branch includes the following new commits:

     new fac864e03 UNOMI-689: avoid load(null) to crash Exceptions

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[unomi] 01/01: UNOMI-689: avoid load(null) to crash Exceptions

Posted by jk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jkevan pushed a commit to branch UNOMI-689
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit fac864e035691147704af895f6a0301b15bd744f
Author: Kevan <ke...@jahia.com>
AuthorDate: Thu Feb 9 18:05:49 2023 +0100

    UNOMI-689: avoid load(null) to crash Exceptions
---
 .../elasticsearch/ElasticSearchPersistenceServiceImpl.java            | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java b/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java
index 864548f3e..231329ea0 100644
--- a/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java
+++ b/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java
@@ -805,6 +805,10 @@ public class ElasticSearchPersistenceServiceImpl implements PersistenceService,
     }
 
     private <T extends Item> T load(final String itemId, final Class<T> clazz, final String customItemType) {
+        if (StringUtils.isEmpty(itemId)) {
+            return null;
+        }
+
         return new InClassLoaderExecute<T>(metricsService, this.getClass().getName() + ".loadItem", this.bundleContext, this.fatalIllegalStateErrors, throwExceptions) {
             protected T execute(Object... args) throws Exception {
                 try {