summaryrefslogtreecommitdiffstats
path: root/cras.c
diff options
context:
space:
mode:
Diffstat (limited to 'cras.c')
-rw-r--r--cras.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cras.c b/cras.c
index 562ae0b..162796a 100644
--- a/cras.c
+++ b/cras.c
@@ -253,9 +253,11 @@ mark_list_mode(const char *crasfile, const char *id, int value)
die("Task number must be greater than zero.");
}
+ task = NULL;
if (tasknum <= task_lst_get_size(list))
task = task_lst_get_task(list, tasknum - 1);
+ /* If task is still NULL, then it means tasknum wasn't within range. */
if (task == NULL) {
task_lst_cleanup(&list);
die("Task #%d does not exist.", tasknum);