Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix an error when closing the file #61

Merged
merged 1 commit into from
Sep 24, 2022
Merged

fix an error when closing the file #61

merged 1 commit into from
Sep 24, 2022

Conversation

doitian
Copy link
Contributor

@doitian doitian commented Sep 23, 2022

It seems that Obsidian will trigger the event file-open with null when closing the file.

app.js:1 Uncaught TypeError: Cannot read properties of null (reading 'path')
    at eval (plugin:obsidian-filename-heading-sync:123:85)
    at t.e.tryTrigger (app.js:1:963725)
    at t.e.trigger (app.js:1:963658)
    at t.trigger (app.js:1:1520211)
    at t.activeLeafEvents (app.js:1:1510656)
    at a (app.js:1:264427)

It seems that Obsidian will trigger the event `file-open` with `null` when closing the file.

```
app.js:1 Uncaught TypeError: Cannot read properties of null (reading 'path')
    at eval (plugin:obsidian-filename-heading-sync:123:85)
    at t.e.tryTrigger (app.js:1:963725)
    at t.e.trigger (app.js:1:963658)
    at t.trigger (app.js:1:1520211)
    at t.activeLeafEvents (app.js:1:1510656)
    at a (app.js:1:264427)
```
@dvcrn
Copy link
Owner

dvcrn commented Sep 24, 2022

Sweet, thanks for this!

@dvcrn dvcrn merged commit 0c0a439 into dvcrn:master Sep 24, 2022
@doitian doitian deleted the patch-1 branch September 30, 2022 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants