mirror of https://github.com/PatrickLipka/tt.git
Added check if active task exists before attempt to start stracking
This commit is contained in:
parent
7b7a4dcc0c
commit
bcaa73fa79
|
@ -210,8 +210,12 @@ void command_start(std::string input, ProjectList *proj_list){
|
||||||
|
|
||||||
if (str.length() == 0){
|
if (str.length() == 0){
|
||||||
// start tracking for active task
|
// start tracking for active task
|
||||||
|
if (proj_list->active_project == NULL || proj_list->active_project->active_task == NULL){
|
||||||
|
std::cout << "Project list or current project is empty. Please add projects/tasks first." << std::endl;
|
||||||
|
}else{
|
||||||
track(proj_list->active_project);
|
track(proj_list->active_project);
|
||||||
command_save(proj_list);
|
command_save(proj_list);
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
// change active task and start tracking
|
// change active task and start tracking
|
||||||
int place_of_slash = str.find("/");
|
int place_of_slash = str.find("/");
|
||||||
|
|
Loading…
Reference in New Issue