From d0d271cdd1fbe5ff3fbe9a50adeb87733eeb4420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Oliva?= Date: Sat, 27 May 2023 14:39:58 -0600 Subject: If due_date is not set, don't use `substring`. --- src/App.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/App.jsx b/src/App.jsx index 8397a9f..832db93 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -18,7 +18,10 @@ function App() { set_todo({ id: todo.id, text: todo.text, - due_date: todo.dueDate.substring(0, 16), + due_date: + todo.dueDate != null + ? todo.dueDate.substring(0, 16) + : todo.dueDate, done: todo.done, priority: todo.priority, creation_date: todo.creationDate, -- cgit v1.2.3