Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update schedule.go to accept a context.Context; fix fatal bug #307

Merged
merged 1 commit into from Mar 17, 2021

Conversation

theckman
Copy link
Collaborator

@theckman theckman commented Mar 6, 2021

While adding context.Context support to the schedule.go file, I found a
nil map write in PreviewSchedule(). This makes me believe this method may be
unused, otherwise I would expect a panic report.

Updates #267

While adding `context.Context` support to the `schedule.go` file, I found a
`nil` map write in PreviewSchedule(). This makes me believe this method may be
unused, otherwise I would expect a panic report.

Updates #267
@theckman theckman added the bug label Mar 6, 2021
@theckman theckman added this to the v1.4.0 milestone Mar 6, 2021
v, err := query.Values(o)
if err != nil {
return err
}
var data map[string]Schedule
data["schedule"] = s
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two lines being removed are the bug I am referring to.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! I have been able to reproduce the bug you mentioned and verified that this approach no longer panics.

Copy link
Contributor

@stmcallister stmcallister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! And thanks for the bug fix as well! 🎉 🎉

v, err := query.Values(o)
if err != nil {
return err
}
var data map[string]Schedule
data["schedule"] = s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! I have been able to reproduce the bug you mentioned and verified that this approach no longer panics.

@stmcallister stmcallister merged commit 176a8a3 into master Mar 17, 2021
@stmcallister stmcallister deleted the ctx_schedule branch March 17, 2021 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants