You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by js...@apache.org on 2023/03/14 09:15:36 UTC
[unomi] branch UNOMI-747-add-null-check created (now 493358a88)
This is an automated email from the ASF dual-hosted git repository.
jsinovassinnaik pushed a change to branch UNOMI-747-add-null-check
in repository https://gitbox.apache.org/repos/asf/unomi.git
at 493358a88 UNOMI-747 : add null check in events migration script
This branch includes the following new commits:
new 493358a88 UNOMI-747 : add null check in events migration script
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-747 : add null check in events migration script
Posted by js...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jsinovassinnaik pushed a commit to branch UNOMI-747-add-null-check
in repository https://gitbox.apache.org/repos/asf/unomi.git
commit 493358a88447f61cdee436e2d444d0b687f132da
Author: jsinovassin <js...@jahia.com>
AuthorDate: Tue Mar 14 10:15:16 2023 +0100
UNOMI-747 : add null check in events migration script
---
.../src/main/resources/requestBody/2.0.0/event_migrate.painless | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/shell-commands/src/main/resources/requestBody/2.0.0/event_migrate.painless b/tools/shell-commands/src/main/resources/requestBody/2.0.0/event_migrate.painless
index 800fa97b7..9fd7e968a 100644
--- a/tools/shell-commands/src/main/resources/requestBody/2.0.0/event_migrate.painless
+++ b/tools/shell-commands/src/main/resources/requestBody/2.0.0/event_migrate.painless
@@ -20,8 +20,12 @@ if ('login' == ctx._source.eventType) {
/* Look for empty scope */
if (ctx._source.scope == '') {
ctx._source.put('scope', 'systemsite');
- ctx._source.source.put('scope', 'systemsite');
- ctx._source.target.put('scope', 'systemsite');
+ if (ctx._source.source != null) {
+ ctx._source.source.put('scope', 'systemsite');
+ }
+ if (ctx._source.target != null) {
+ ctx._source.target.put('scope', 'systemsite');
+ }
}
}
/* Handle view events */