npe
This commit is contained in:
parent
87ac346c28
commit
18e27f3038
|
@ -43,11 +43,11 @@ public class InsertTaskListJob implements ITask {
|
||||||
Map<String, Object> key = (Map<String, Object>) index;
|
Map<String, Object> key = (Map<String, Object>) index;
|
||||||
String eventType = (String) key.get("eventType");
|
String eventType = (String) key.get("eventType");
|
||||||
String eventCnName = (String) key.get("eventCnName");
|
String eventCnName = (String) key.get("eventCnName");
|
||||||
JSONObject taskListBody = shangTangService.tasklist(eventType);
|
Optional<JSONObject> taskListBody = Optional.ofNullable(shangTangService.tasklist(eventType));
|
||||||
if (taskListBody.isEmpty()) {
|
if (!taskListBody.isPresent() || taskListBody.get().isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Optional<JSONObject> taskdatajobj = Optional.ofNullable(taskListBody.getJSONObject("data"));
|
Optional<JSONObject> taskdatajobj = Optional.ofNullable(taskListBody.get().getJSONObject("data"));
|
||||||
taskdatajobj.ifPresent(task -> {
|
taskdatajobj.ifPresent(task -> {
|
||||||
Optional<JSONArray> taskdatajobjJSONArray = Optional.ofNullable(task.getJSONArray("dataList"));
|
Optional<JSONArray> taskdatajobjJSONArray = Optional.ofNullable(task.getJSONArray("dataList"));
|
||||||
taskdatajobjJSONArray.orElse(new JSONArray()).stream().forEach(index_ -> {
|
taskdatajobjJSONArray.orElse(new JSONArray()).stream().forEach(index_ -> {
|
||||||
|
|
Loading…
Reference in New Issue