mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-28 13:37:20 +02:00
TW-1460
- Display error for empty due: attribute when adding recurring tasks. - Prevent endless loop for tasks that have an empty due: attribute.
This commit is contained in:
parent
7422a76153
commit
00b15ca407
2 changed files with 5 additions and 1 deletions
|
@ -1451,7 +1451,7 @@ void Task::validate (bool applyDefault /* = true */)
|
||||||
throw std::string (STRING_TASK_VALID_BLANK);
|
throw std::string (STRING_TASK_VALID_BLANK);
|
||||||
|
|
||||||
// Cannot have a recur frequency with no due date - when would it recur?
|
// Cannot have a recur frequency with no due date - when would it recur?
|
||||||
if (! has ("due") && has ("recur"))
|
if (has ("recur") && (! has ("due") || get ("due") == ""))
|
||||||
throw std::string (STRING_TASK_VALID_REC_DUE);
|
throw std::string (STRING_TASK_VALID_REC_DUE);
|
||||||
|
|
||||||
// Recur durations must be valid.
|
// Recur durations must be valid.
|
||||||
|
|
|
@ -159,6 +159,10 @@ bool generateDueDates (Task& parent, std::vector <Date>& allDue)
|
||||||
{
|
{
|
||||||
// Determine due date, recur period and until date.
|
// Determine due date, recur period and until date.
|
||||||
Date due (parent.get_date ("due"));
|
Date due (parent.get_date ("due"));
|
||||||
|
if (due == 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
std::string recur = parent.get ("recur");
|
std::string recur = parent.get ("recur");
|
||||||
|
|
||||||
bool specificEnd = false;
|
bool specificEnd = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue