Skip to content

Commit

Permalink
fix nil deference for all API callers
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Feb 1, 2023
1 parent d9633e5 commit dfd8f9e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion api/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ func (p *PeriodicConfig) Canonicalize() {
// returned. The `time.Location` of the returned value matches that of the
// passed time.
func (p *PeriodicConfig) Next(fromTime time.Time) (time.Time, error) {
if *p.SpecType == PeriodicSpecCron {
if p != nil && *p.SpecType == PeriodicSpecCron {
e, err := cronexpr.Parse(*p.Spec)
if err != nil {
return time.Time{}, fmt.Errorf("failed parsing cron expression %q: %v", *p.Spec, err)
Expand Down
3 changes: 0 additions & 3 deletions command/job_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,6 @@ func (c *JobRunCommand) Run(args []string) int {

evalID := resp.EvalID

// #13844: canonicalize the job in case it was a partial API definition
job.Canonicalize()

// Check if we should enter monitor mode
if detach || periodic || paramjob || multiregion {
c.Ui.Output("Job registration successful")
Expand Down

0 comments on commit dfd8f9e

Please sign in to comment.