Skip to content

Commit b75b00c

Browse files
LordofAvernusffffwh
authored and
ffffwh
committed
refactor : add parameter check
1 parent 6958a99 commit b75b00c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/api/handler/v2/job.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,9 @@ func buildRestartPolicy(RestartAttempts int) (*nomadApi.ReschedulePolicy, *nomad
539539

540540
func buildDatabaseDestTaskConfigMap(config *models.DestTaskConfig) map[string]interface{} {
541541
taskConfigInNomadFormat := make(map[string]interface{})
542-
542+
if config.MysqlDestTaskConfig == nil{
543+
return taskConfigInNomadFormat
544+
}
543545
addNotRequiredParamToMap(taskConfigInNomadFormat, config.MysqlDestTaskConfig.ParallelWorkers, "ParallelWorkers")
544546
addNotRequiredParamToMap(taskConfigInNomadFormat, config.MysqlDestTaskConfig.UseMySQLDependency, "UseMySQLDependency")
545547
addNotRequiredParamToMap(taskConfigInNomadFormat, config.MysqlDestTaskConfig.DependencyHistorySize, "DependencyHistorySize")

0 commit comments

Comments
 (0)