obsidian-writing-goals icon indicating copy to clipboard operation
obsidian-writing-goals copied to clipboard

Error when canvas file is in the folder

Open anareaty opened this issue 1 year ago • 2 comments

I add word count goal to the folder. It works correctly. But if I add the canvas file to this folder and reload Obsidian, word count stops showing and this error shows up:

plugin:writing-goals:20432 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'contains')
    at GoalHelper.additionalFileTypes (plugin:writing-goals:20432:50)
    at GoalHelper.isValidFile (plugin:writing-goals:20429:98)
    at GoalHelper.getWordCountRecursive (plugin:writing-goals:20416:18)
    at GoalHelper.getWordCountRecursive (plugin:writing-goals:20423:44)
    at GoalHelper.createGoal (plugin:writing-goals:20340:87)
    at GoalHelper.updateGoalsFromSettings (plugin:writing-goals:20408:37)
    at async WritingGoals.loadNoteGoalData (plugin:writing-goals:22339:9)

I didn't add anything to the additional file types setting, so I expected canvas files to be ignored. Instead they are breaking something.

anareaty avatar Jan 07 '24 19:01 anareaty