Skip to content

Commit

Permalink
avoid nil map dst
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Feb 23, 2024
1 parent a63b0e7 commit 27f896b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion flow/workflows/cdc_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,11 @@ func CDCFlowWorkflowWithConfig(
})
syncResultChan := model.SyncResultSignal.GetSignalChannel(ctx)
syncResultChan.AddToSelector(mainLoopSelector, func(result model.SyncResponse, _ bool) {
maps.Copy(state.SyncFlowOptions.RelationMessageMapping, result.RelationMessageMapping)
if state.SyncFlowOptions.RelationMessageMapping == nil {
state.SyncFlowOptions.RelationMessageMapping = result.RelationMessageMapping
} else {
maps.Copy(state.SyncFlowOptions.RelationMessageMapping, result.RelationMessageMapping)
}
state.SyncFlowStatuses = append(state.SyncFlowStatuses, result)
})

Expand Down

0 comments on commit 27f896b

Please sign in to comment.