This is an automated email from the ASF dual-hosted git repository.

vasas pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/sqoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new e90e244  SQOOP-3435: Avoid NullPointerException due to different 
JSONObject library in classpath
e90e244 is described below

commit e90e244396ecffeb332633c89e641357adcf8eda
Author: Tak Lon (Stephen) Wu <[email protected]>
AuthorDate: Wed Apr 3 01:38:33 2019 -0700

    SQOOP-3435: Avoid NullPointerException due to different JSONObject library 
in classpath
---
 src/java/org/apache/sqoop/util/SqoopJsonUtil.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/java/org/apache/sqoop/util/SqoopJsonUtil.java 
b/src/java/org/apache/sqoop/util/SqoopJsonUtil.java
index adf186b..9e8ba95 100644
--- a/src/java/org/apache/sqoop/util/SqoopJsonUtil.java
+++ b/src/java/org/apache/sqoop/util/SqoopJsonUtil.java
@@ -40,7 +40,8 @@ public class SqoopJsonUtil {
   }
 
   public static String getJsonStringforMap(Map<String, String> map) {
-    JSONObject pathPartMap = new JSONObject(map);
+    Map<String, String> mapToUse = (map == null) ? Collections.emptyMap() : 
map;
+    JSONObject pathPartMap = new JSONObject(mapToUse);
     return pathPartMap.toString();
   }
 

Reply via email to