Program panicked when number of fields less than 5
LemonNekoGH opened this issue · comments
I got error when i parse wrong cron expression: * * * *
index out of bounds: the len is 4 but the index is 4
And i found this line try to get field by index 4:
Line 187 in 37500d2
Then i found these line checked if number of fields greater than 5, will throw a error:
Lines 123 to 125 in 37500d2
Should we throw a error if number of fields less than 4? Like this:
if fields.len() != 5 {
return Err(ParseError::InvalidCron);
}
Hi @LemonNekoGH, many thanks, fixed 👍