anufrievroman / calcure

Modern TUI calendar and task manager with minimal and customizable UI.
https://anufrievroman.gitbook.io/calcure
MIT License
1.51k stars 43 forks source link

Fix crash when creating first-ever Task #24

Closed ethall closed 2 years ago

ethall commented 2 years ago

Previously, when there were no Tasks and Tasks.generate_id was called, the max function would throw a ValueError.

Now we check to see if the Task list is empty before generating a new ID. If empty, then the generated ID will always be 0.

Resolves #23

anufrievroman commented 2 years ago

Thanks a lot for the fix!