Repository: incubator-unomi
Updated Branches:
  refs/heads/master 6e6b1e951 -> 0a19fa0ce


Property Value null issue on export


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

Branch: refs/heads/master
Commit: 0a19fa0cede5d3aeb29d8c0bc10b18882065ae5e
Parents: 6e6b1e9
Author: Abdelkader Midani <amid...@apache.org>
Authored: Thu Aug 17 16:57:37 2017 +0200
Committer: Abdelkader Midani <amid...@apache.org>
Committed: Thu Aug 17 16:57:37 2017 +0200

----------------------------------------------------------------------
 .../unomi/router/services/ProfileExportServiceImpl.java | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/0a19fa0c/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileExportServiceImpl.java
----------------------------------------------------------------------
diff --git 
a/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileExportServiceImpl.java
 
b/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileExportServiceImpl.java
index f02a406..c2bb635 100644
--- 
a/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileExportServiceImpl.java
+++ 
b/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileExportServiceImpl.java
@@ -85,11 +85,15 @@ public class ProfileExportServiceImpl extends 
AbstractCustomServiceImpl implemen
                 lineToWrite += 
StringUtils.isNotBlank(exportConfiguration.getMultiValueDelimiter()) ? 
exportConfiguration.getMultiValueDelimiter().charAt(1) : "";
 
             } else {
-                propertyValue = propertyValue.toString().replaceAll("\"", 
"\"\"");
-                if (StringUtils.contains(propertyValue.toString(), 
exportConfiguration.getColumnSeparator())) {
-                    propertyValue = "\"" + propertyValue + "\"";
+                if(propertyValue != null) {
+                    propertyValue = propertyValue.toString().replaceAll("\"", 
"\"\"");
+                    if (StringUtils.contains(propertyValue.toString(), 
exportConfiguration.getColumnSeparator())) {
+                        propertyValue = "\"" + propertyValue + "\"";
+                    }
+                    lineToWrite += propertyValue.toString();
+                } else {
+                    lineToWrite += "";
                 }
-                lineToWrite += propertyValue.toString() != null ? 
propertyValue.toString() : "";
             }
             if (i + 1 < mapping.size()) {
                 lineToWrite += exportConfiguration.getColumnSeparator();

Reply via email to