This is an automated email from the ASF dual-hosted git repository. jsinovassinnaik pushed a commit to branch unomi-1.x in repository https://gitbox.apache.org/repos/asf/unomi.git
The following commit(s) were added to refs/heads/unomi-1.x by this push: new 3c0aa81fe UNOMI-745 : check condition to avoid NPE (#594) 3c0aa81fe is described below commit 3c0aa81fe004da1e2b63ddd5a7c91861f92d7ab2 Author: jsinovassin <58434978+jsinovas...@users.noreply.github.com> AuthorDate: Wed Mar 22 19:06:10 2023 +0000 UNOMI-745 : check condition to avoid NPE (#594) * UNOMI-745 : check condition to avoid NPE * refresh groovy index after remove --- .../src/test/java/org/apache/unomi/itests/GroovyActionsServiceIT.java | 2 +- itests/src/test/java/org/apache/unomi/itests/SegmentIT.java | 2 +- services/src/main/java/org/apache/unomi/services/impl/ParserHelper.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/itests/src/test/java/org/apache/unomi/itests/GroovyActionsServiceIT.java b/itests/src/test/java/org/apache/unomi/itests/GroovyActionsServiceIT.java index a0d42cd3e..1382533d5 100644 --- a/itests/src/test/java/org/apache/unomi/itests/GroovyActionsServiceIT.java +++ b/itests/src/test/java/org/apache/unomi/itests/GroovyActionsServiceIT.java @@ -162,7 +162,7 @@ public class GroovyActionsServiceIT extends BaseIT { Assert.assertNotNull(groovyCodeSource); groovyActionsService.remove(UPDATE_ADDRESS_ACTION); - refreshPersistence(GroovyAction.class); + refreshPersistence(GroovyAction.class, ActionType.class); Thread.sleep(2000); groovyCodeSource = groovyActionsService.getGroovyCodeSource(UPDATE_ADDRESS_ACTION); diff --git a/itests/src/test/java/org/apache/unomi/itests/SegmentIT.java b/itests/src/test/java/org/apache/unomi/itests/SegmentIT.java index 53a3c9da4..d230a07c3 100644 --- a/itests/src/test/java/org/apache/unomi/itests/SegmentIT.java +++ b/itests/src/test/java/org/apache/unomi/itests/SegmentIT.java @@ -544,7 +544,7 @@ public class SegmentIT extends BaseIT { scoringElements.add(scoringElement); scoring.setElements(scoringElements); segmentService.setScoringDefinition(scoring); - refreshPersistence(Scoring.class); + refreshPersistence(Scoring.class, Profile.class); // Send 2 events that match the scoring plan. profile = profileService.load("test_profile_id"); diff --git a/services/src/main/java/org/apache/unomi/services/impl/ParserHelper.java b/services/src/main/java/org/apache/unomi/services/impl/ParserHelper.java index d4efb3a47..f7896beb3 100644 --- a/services/src/main/java/org/apache/unomi/services/impl/ParserHelper.java +++ b/services/src/main/java/org/apache/unomi/services/impl/ParserHelper.java @@ -190,7 +190,7 @@ public class ParserHelper { eventTypeIds.add(eventTypeId); } } - } else if (condition.getConditionType().getParentCondition() != null) { + } else if (condition.getConditionType() != null && condition.getConditionType().getParentCondition() != null) { visitConditions(condition.getConditionType().getParentCondition(), this); } }