5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-03 03:40:34 +08:00

SQOOP-3435: Avoid NullPointerException due to different JSONObject library in classpath

This commit is contained in:
Tak Lon (Stephen) Wu 2019-04-03 01:38:33 -07:00 committed by Szabolcs Vasas
parent 0216f7fbb7
commit e90e244396

View File

@ -40,7 +40,8 @@ private SqoopJsonUtil() {
} }
public static String getJsonStringforMap(Map<String, String> map) { 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(); return pathPartMap.toString();
} }