Skip to content

Commit 9e42697

Browse files
authored
chore: replacing Optional with null check
1 parent efbed09 commit 9e42697

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutorOps.java

+4-6
Original file line numberDiff line numberDiff line change
@@ -870,12 +870,10 @@ public TaskModel updateTask(TaskResult taskResult) {
870870
LOGGER.error(errorMsg, e);
871871
}
872872
List<TaskExecLog> taskLogs = taskResult.getLogs();
873-
Optional.ofNullable(taskLogs)
874-
.ifPresent(
875-
logs -> {
876-
logs.forEach(taskExecLog -> taskExecLog.setTaskId(task.getTaskId()));
877-
executionDAOFacade.addTaskExecLog(taskLogs);
878-
});
873+
if (null != taskLogs) {
874+
taskLogs.forEach(taskExecLog -> taskExecLog.setTaskId(task.getTaskId()));
875+
executionDAOFacade.addTaskExecLog(taskLogs);
876+
}
879877
if (task.getStatus().isTerminal()) {
880878
long duration = getTaskDuration(0, task);
881879
long lastDuration = task.getEndTime() - task.getStartTime();

0 commit comments

Comments
 (0)