diff --git a/core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutorOps.java b/core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutorOps.java index 6affdff81..ecc9eda2b 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutorOps.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutorOps.java @@ -869,10 +869,13 @@ public TaskModel updateTask(TaskResult taskResult) { task.getTaskId(), workflowId); LOGGER.error(errorMsg, e); } - - taskResult.getLogs().forEach(taskExecLog -> taskExecLog.setTaskId(task.getTaskId())); - executionDAOFacade.addTaskExecLog(taskResult.getLogs()); - + List taskLogs = taskResult.getLogs(); + Optional.ofNullable(taskLogs) + .ifPresent( + logs -> { + logs.forEach(taskExecLog -> taskExecLog.setTaskId(task.getTaskId())); + executionDAOFacade.addTaskExecLog(taskLogs); + }); if (task.getStatus().isTerminal()) { long duration = getTaskDuration(0, task); long lastDuration = task.getEndTime() - task.getStartTime();