diff options
-rw-r--r-- | src/taskmanager.cc | 6 |
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); |