Skip to content

Commit

Permalink
make sure there is a task associated with checlistitem
Browse files Browse the repository at this point in the history
  • Loading branch information
liamcain committed Jan 31, 2021
1 parent 11731fc commit 409a030
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
12 changes: 8 additions & 4 deletions src/things.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}
});

Expand Down

0 comments on commit 409a030

Please sign in to comment.