Closed sevagh closed 6 years ago
15-0
is not valid range. The documentation says allowed values for hour are between 0 and 23, and further states:
As of now, the behavior of the code is undetermined if a malformed cron expression is supplied
Thanks for the reply.
Field name Mandatory? Allowed values Allowed special characters
---------- ---------- -------------- --------------------------
Hours Yes 0-23 * / , -
But it says -
is an allowed special character for the hour field, am I misunderstanding that?
15-23
would be valid. But what is 15-0
supposed to mean?
Aw crap, you're right. Crontab.guru rejects it: https://crontab.guru/#1_15-0_*_*_1-5
15-0
is indeed garbage. I must have mistyped it into crontab.guru the first time.
Thanks much for the help!
@gorhill Can we have this be returned as an error from Parse?
Hello, tracing a bug via Nomad (which uses this library), I've discovered that the following expression causes a nil pointer exception:
Digging into the code, it's this:
It produces an empty list when trying to parse
15-0
:hour: 15-0 parsed: []
- this leads toexpr.hourList[0]
producing a nil pointer over here: https://github.com/gorhill/cronexpr/blob/master/cronexpr_next.go#L115Is this syntax supposed to be supported? Your doc says hyphens are.
Here's the stacktrace: