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;
|
||||
String eventType = (String) key.get("eventType");
|
||||
String eventCnName = (String) key.get("eventCnName");
|
||||
JSONObject taskListBody = shangTangService.tasklist(eventType);
|
||||
if (taskListBody.isEmpty()) {
|
||||
Optional<JSONObject> taskListBody = Optional.ofNullable(shangTangService.tasklist(eventType));
|
||||
if (!taskListBody.isPresent() || taskListBody.get().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Optional<JSONObject> taskdatajobj = Optional.ofNullable(taskListBody.getJSONObject("data"));
|
||||
Optional<JSONObject> taskdatajobj = Optional.ofNullable(taskListBody.get().getJSONObject("data"));
|
||||
taskdatajobj.ifPresent(task -> {
|
||||
Optional<JSONArray> taskdatajobjJSONArray = Optional.ofNullable(task.getJSONArray("dataList"));
|
||||
taskdatajobjJSONArray.orElse(new JSONArray()).stream().forEach(index_ -> {
|
||||
|
|
Loading…
Reference in New Issue