mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
TI-64: Command 'stop' with date before current interval's start date causes segfault
- Show error message if stop date is before current interval's start date - Add test for this use case
This commit is contained in:
parent
403b1c6f5e
commit
e505129d5c
2 changed files with 11 additions and 0 deletions
|
@ -62,7 +62,12 @@ int CmdStop (
|
|||
// If a stop date is specified (and occupies filter.range.start) then use
|
||||
// that instead of the current time.
|
||||
if (filter.range.start.toEpoch () != 0)
|
||||
{
|
||||
if (modified.range.start >= filter.range.start)
|
||||
throw std::string ("The end of a date range must be after the start.");
|
||||
|
||||
modified.range.end = filter.range.start;
|
||||
}
|
||||
else
|
||||
modified.range.end = Datetime ();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue