UNOMI-117 fix issue with version not present in some object

Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/003f8e9c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/003f8e9c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/003f8e9c

Branch: refs/heads/master
Commit: 003f8e9c866b7fb3301ba95a1329b525938ff4ad
Parents: 6a4a7e6
Author: dgaillard <[email protected]>
Authored: Sat Sep 30 11:19:50 2017 +0200
Committer: dgaillard <[email protected]>
Committed: Sat Sep 30 11:19:50 2017 +0200

----------------------------------------------------------------------
 .../apache/unomi/services/services/DefinitionsServiceImpl.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/003f8e9c/services/src/main/java/org/apache/unomi/services/services/DefinitionsServiceImpl.java
----------------------------------------------------------------------
diff --git 
a/services/src/main/java/org/apache/unomi/services/services/DefinitionsServiceImpl.java
 
b/services/src/main/java/org/apache/unomi/services/services/DefinitionsServiceImpl.java
index 7c4252e..583cbc5 100644
--- 
a/services/src/main/java/org/apache/unomi/services/services/DefinitionsServiceImpl.java
+++ 
b/services/src/main/java/org/apache/unomi/services/services/DefinitionsServiceImpl.java
@@ -239,7 +239,7 @@ public class DefinitionsServiceImpl implements 
DefinitionsService, SynchronousBu
             return null;
         }
         ConditionType type = conditionTypeById.get(id);
-        if (type == null) {
+        if (type == null || type.getVersion() == null) {
             type = persistenceService.load(id, ConditionType.class);
             conditionTypeById.put(id, type);
         }
@@ -281,7 +281,7 @@ public class DefinitionsServiceImpl implements 
DefinitionsService, SynchronousBu
 
     public ActionType getActionType(String id) {
         ActionType type = actionTypeById.get(id);
-        if (type == null) {
+        if (type == null || type.getVersion() == null) {
             type = persistenceService.load(id, ActionType.class);
             actionTypeById.put(id, type);
         }

Reply via email to