From 9e64ae281da0c3297a36cc25a57229bf1c2d47db Mon Sep 17 00:00:00 2001 From: mecaneer23 Date: Tue, 30 Apr 2024 12:38:21 -0500 Subject: [PATCH] refactor: remove unnecessary variable --- todo.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/todo.py b/todo.py index 68bfc00..f6b9876 100755 --- a/todo.py +++ b/todo.py @@ -357,8 +357,7 @@ def _handle_enter( selected: Cursor, mode: SingleLineModeImpl, ) -> Todos: - todo = todos[int(selected)] if len(todos) > 0 else Todo() - if todo.has_box(): + if len(todos) > 0 and todos[int(selected)].has_box(): return toggle(todos, selected) return new_todo_next(stdscr, todos, selected, Todo(), mode=mode)