Skip to content

Commit 6c52c63

Browse files
authored
fix: one more possible null deref (#1560)
1 parent 9a0c5ac commit 6c52c63

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/repository/postgres/workflow.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,12 @@ func (w *workflowAPIRepository) CreateCronWorkflow(ctx context.Context, tenantId
390390
}
391391
}
392392

393+
var priority int32 = 1
394+
395+
if opts.Priority != nil {
396+
priority = *opts.Priority
397+
}
398+
393399
createParams := dbsqlc.CreateWorkflowTriggerCronRefForWorkflowParams{
394400
Workflowid: sqlchelpers.UUIDFromStr(opts.WorkflowId),
395401
Crontrigger: opts.Cron,
@@ -400,7 +406,7 @@ func (w *workflowAPIRepository) CreateCronWorkflow(ctx context.Context, tenantId
400406
Valid: true,
401407
WorkflowTriggerCronRefMethods: dbsqlc.WorkflowTriggerCronRefMethodsAPI,
402408
},
403-
Priority: sqlchelpers.ToInt(*opts.Priority),
409+
Priority: sqlchelpers.ToInt(priority),
404410
}
405411

406412
cronTrigger, err := w.queries.CreateWorkflowTriggerCronRefForWorkflow(ctx, w.pool, createParams)

0 commit comments

Comments
 (0)