summaryrefslogtreecommitdiffstats
path: root/src/todo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/todo.c')
-rw-r--r--src/todo.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/todo.c b/src/todo.c
index 9a6f72f..8027803 100644
--- a/src/todo.c
+++ b/src/todo.c
@@ -59,6 +59,9 @@ struct todo *todo_get_item(int item_number, int skip_completed)
else
i = LLIST_NTH(&todolist, item_number);
+ if (!i)
+ return NULL;
+
return LLIST_GET_DATA(i);
}