From ae1419826ed2ebc1e95f3ad637a799056fd679a8 Mon Sep 17 00:00:00 2001 From: Preetha Appan Date: Wed, 11 Apr 2018 15:26:01 -0500 Subject: [PATCH] Always merge with default reschedule policy if its not nil --- api/tasks.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/tasks.go b/api/tasks.go index e66ed9557..7a74a6355 100644 --- a/api/tasks.go +++ b/api/tasks.go @@ -103,6 +103,9 @@ type ReschedulePolicy struct { } func (r *ReschedulePolicy) Merge(rp *ReschedulePolicy) { + if rp == nil { + return + } if rp.Interval != nil { r.Interval = rp.Interval } @@ -432,7 +435,7 @@ func (g *TaskGroup) Canonicalize(job *Job) { } } - if defaultReschedulePolicy != nil && g.ReschedulePolicy != nil { + if defaultReschedulePolicy != nil { defaultReschedulePolicy.Merge(g.ReschedulePolicy) g.ReschedulePolicy = defaultReschedulePolicy }