summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/taskmanager.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/taskmanager.cc b/src/taskmanager.cc
index 7857d12..5f8e2d7 100644
--- a/src/taskmanager.cc
+++ b/src/taskmanager.cc
@@ -110,7 +110,13 @@ TaskIdListPair TaskManager::moveTask(taskid_t id, taskid_t to)
if(isProtected(id)) return TaskIdListPair();
+ if(id == to) throw std::exception(); // Node and new parent are the same node.
+
task_t t = tree.data(id);
+
+ // Make sure the new parent exists. This will throw an exception if it doesn't
+ task_t t_ = tree.data(to);
+
t.parentid = to;
TaskIdList tilremove = tree.remove(id);