marcusolsson/obsidian-projects

Creating a new note in tag based project fails if the template does not contain any tags

Closed this issue · 2 comments

What happened?

If you create a note in a project with a template that does not contain any tags – for example, either the tags field in frontmatter being empty or non-existing, the note does not get created.

What did you expect to happen?

The note getting created.

How can we reproduce it (as minimally and precisely as possible)?

Set up a tag-based project, assign a template as described above, and create a new note.

Anything else we need to know?

This is the error from the console:

plugin:obsidian-projects:31274 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'concat')
    at DataApi.eval (plugin:obsidian-projects:31274:49)
    at Generator.next (<anonymous>)
    at fulfilled (plugin:obsidian-projects:72:24)

This should be pretty easy to fix with conditionally using an empty list if tags are null here.1
Unfortunately, I'm pretty busy right now, so currently I can't fix it myself, but I at least wanted to create this issue for now.

Plugin version

1.17.1

Obsidian version

1.5.8

OS

macOS

Footnotes

  1. I checked again and this does not really make sense looking at the code, but it should still be easy to figure out, I guess.

Thx! Will give this a check.

Will soon build a new release. Many thanks for reporting and locating this problem!