diff --git a/manifest.json b/manifest.json index 4b5e05b..deee8d0 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "id": "things-logbook", "name": "Things Logbook", "description": "Sync your Things.app Logbook with Daily Notes", - "version": "0.1.5", + "version": "0.1.6", "author": "Liam Cain", "authorUrl": "https://github.com/liamcain/", "isDesktopOnly": false, diff --git a/package.json b/package.json index a7944da..a4d685e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-things-logbook-plugin", - "version": "0.1.5", + "version": "0.1.6", "description": "Sync Things.app Logbook with Obsidian", "author": "liamcain", "main": "main.js", diff --git a/src/things.ts b/src/things.ts index 353dc2e..023208e 100644 --- a/src/things.ts +++ b/src/things.ts @@ -67,10 +67,14 @@ export function buildTasksFromSQLRecords( completed: !!stopDate, title, }; - if (task.subtasks) { - task.subtasks.push(subtask); - } else { - task.subtasks = [subtask]; + + // checklist item might be completed before task + if (task) { + if (task.subtasks) { + task.subtasks.push(subtask); + } else { + task.subtasks = [subtask]; + } } });