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

TypeError: Cannot read properties of null (reading 'path') at deduplicateNewName #145

Open
luckman212 opened this issue Jul 23, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@luckman212
Copy link
Contributor

I notice sometimes that instead of renaming pasted attachments, I get a TypeError. This happens when pasting immediately after editing the note content. Not sure what is causing it.

  • Obsidian 1.6.7
  • macOS 14.5
  • Plugin ver 0.9.13

image

@luckman212
Copy link
Contributor Author

Yes, I think this is fixed in 0.9.14
Thank you @trganda and @Xheng222 🚀

@luckman212
Copy link
Contributor Author

@trganda I am so sorry but, for me this bug is still happening sometimes! Even after updating to 0.9.14. I don't know if it's an Obsidian bug or problem of the plugin.

@luckman212 luckman212 reopened this Jul 26, 2024
@trganda
Copy link
Owner

trganda commented Jul 27, 2024

Hi @luckman212, looks like the this.app.vault.getAbstractFileByPath(attachPath) return a null object.

I'm not sure why this happen in your case. If you encounter this error again, please check whether the attachPath has been success created in your vault and provide me with your plugin configuration file.

@luckman212
Copy link
Contributor Author

Ok trganda, I will try to debug a little closer and keep an eye. I think this is a timing issue, maybe a bug in Obsidian where the Vault cache is not yet updated when the plugin tries to change the text content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants