Skip to content

Commit

Permalink
add nil check since there's a codepath where normalize activity retur…
Browse files Browse the repository at this point in the history
…ns nil
  • Loading branch information
serprex committed Jan 2, 2024
1 parent ac64802 commit 0ebe58a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions flow/activities/flowable.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,8 @@ func (a *FlowableActivity) StartNormalize(
}

// log the number of batches normalized
if res != nil {
slog.InfoContext(ctx, fmt.Sprintf("normalized records from batch %d to batch %d\n",
res.StartBatchID, res.EndBatchID))
}
slog.InfoContext(ctx, fmt.Sprintf("normalized records from batch %d to batch %d\n",
res.StartBatchID, res.EndBatchID))

return res, nil
}
Expand Down
2 changes: 1 addition & 1 deletion flow/workflows/normalize_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func NormalizeFlowWorkflow(ctx workflow.Context,
var normalizeResponse *model.NormalizeResponse
if err := fStartNormalize.Get(normalizeFlowCtx, &normalizeResponse); err != nil {
errors = append(errors, err.Error())
} else {
} else if normalizeResponse != nil {
results = append(results, *normalizeResponse)
}
}
Expand Down

0 comments on commit 0ebe58a

Please sign in to comment.