This is an automated email from the ASF dual-hosted git repository.
shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git
The following commit(s) were added to refs/heads/master by this push:
new c447224 [UNOMI-224] fix an API bug which may crash the program.
new 18e9bc2 This closes pull request number #80
c447224 is described below
commit c44722427f90caa27d374826e2612ba7df5c9821
Author: bd2019us <[email protected]>
AuthorDate: Sun Mar 31 20:00:33 2019 -0500
[UNOMI-224] fix an API bug which may crash the program.
---
.../java/org/apache/unomi/shell/migration/impl/MigrationTo121.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
a/tools/shell-commands/src/main/java/org/apache/unomi/shell/migration/impl/MigrationTo121.java
b/tools/shell-commands/src/main/java/org/apache/unomi/shell/migration/impl/MigrationTo121.java
index 8fd309e..c963aad 100644
---
a/tools/shell-commands/src/main/java/org/apache/unomi/shell/migration/impl/MigrationTo121.java
+++
b/tools/shell-commands/src/main/java/org/apache/unomi/shell/migration/impl/MigrationTo121.java
@@ -101,9 +101,9 @@ public class MigrationTo121 implements Migration {
JSONObject hitSource = hit.getJSONObject("_source");
if (tagsInMetadata && hitSource.has("metadata")) {
JSONObject hitMetadata =
hitSource.getJSONObject("metadata");
- updateTagsForHit(updatedHits,
hit.getString("_id"), hitMetadata, tagsInMetadata, tagsOperation,
removeNamespaceOnSystemTags);
+ updateTagsForHit(updatedHits,
hit.optString("_id"), hitMetadata, tagsInMetadata, tagsOperation,
removeNamespaceOnSystemTags);
} else if (!tagsInMetadata) {
- updateTagsForHit(updatedHits,
hit.getString("_id"), hitSource, tagsInMetadata, tagsOperation,
removeNamespaceOnSystemTags);
+ updateTagsForHit(updatedHits,
hit.optString("_id"), hitSource, tagsInMetadata, tagsOperation,
removeNamespaceOnSystemTags);
}
}
}
@@ -113,7 +113,7 @@ public class MigrationTo121 implements Migration {
}
if (hitsObject.getInt("total") > currentOffset) {
- migrateTagsInResult(hostAddress, type, currentOffset + 10,
tagsInMetadata, tagsOperation, removeNamespaceOnSystemTags,
responseJSON.getString("_scroll_id"));
+ migrateTagsInResult(hostAddress, type, currentOffset + 10,
tagsInMetadata, tagsOperation, removeNamespaceOnSystemTags,
responseJSON.optString("_scroll_id"));
}
}
}