HangfireIO / Cronos

A fully-featured .NET library for working with Cron expressions. Built with time zones in mind and intuitively handles daylight saving time transitions
MIT License
1.01k stars 120 forks source link

CronExpression.TryParse throws with empty string #70

Closed isurakka closed 2 months ago

isurakka commented 6 months ago

CronExpression.TryParse("", out var cronExpression);

This throws ArgumentNullException.

   at Cronos.CronExpression.Parse(String expression, CronFormat format)
   at Cronos.CronExpression.TryParse(String expression, CronFormat format, CronExpression& cronExpression)
   at Cronos.CronExpression.TryParse(String expression, CronExpression& cronExpression)
   at Program.<Main>$(String[] args) in .\Program.cs:line 6

TryParse methods should not throw but return false instead.

odinserj commented 2 months ago

Thanks, fixed!