From a7f7dd6e7b524e8c91a5020b1f78ba4c3383f70e Mon Sep 17 00:00:00 2001 From: Conatum Date: Sat, 10 Sep 2022 01:42:47 +1000 Subject: [PATCH] fix (todo): Correctly filter out empty tasks. --- bot/modules/todo/Tasklist.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot/modules/todo/Tasklist.py b/bot/modules/todo/Tasklist.py index 92195fde..94d6cfdf 100644 --- a/bot/modules/todo/Tasklist.py +++ b/bot/modules/todo/Tasklist.py @@ -470,7 +470,8 @@ class Tasklist: """ Process arguments to an `add` request """ - tasks = [line for line in userstr.splitlines() if line] + tasks = (line.strip() for line in userstr.splitlines()) + tasks = [task for task in tasks if task] if not tasks: # TODO: Maybe have interactive input here return