mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-19 09:53:08 +02:00
Fix Undo command
The Undo command broke in 48dff11
when the `onModify` hook got added to
its execution in order to fix #2213. The reason for it begin broke is
that a Task object is created in an unsafe manner because the `prior`
task may be empty.
Catching this case fixes the bug.
This commit is contained in:
parent
50cfd92ad5
commit
44bcd58051
1 changed files with 3 additions and 1 deletions
|
@ -839,7 +839,9 @@ void TDB2::revert ()
|
||||||
// - erase from completed
|
// - erase from completed
|
||||||
// - if in backlog, erase, else cannot undo
|
// - if in backlog, erase, else cannot undo
|
||||||
|
|
||||||
Task old = Task (prior);
|
Task old = Task ();
|
||||||
|
if (prior != "")
|
||||||
|
old = Task (prior);
|
||||||
Context::getContext ().hooks.onModify (Task (current), old);
|
Context::getContext ().hooks.onModify (Task (current), old);
|
||||||
|
|
||||||
// Modify other data files accordingly.
|
// Modify other data files accordingly.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue