Skip to content

Commit b92e75b

Browse files
authored
fix: deal with lack of opts.attachment (#674)
* fix: deal with lack of opts.attachment * docs: add note for this change
1 parent 7466e3f commit b92e75b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020

2121
- Fixed an edge case with collecting backlinks.
2222
- Fixed typo in `ObsidianPasteImg`'s command description
23+
- Fixed the case when `opts.attachments` is `nil`.
2324

2425
## [v3.9.0](https://github.com/epwalsh/obsidian.nvim/releases/tag/v3.9.0) - 2024-07-11
2526

lua/obsidian/config.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ config.ClientOpts.normalize = function(opts, defaults)
208208
end
209209

210210
if opts.image_name_func then
211+
if opts.attachments == nil then
212+
opts.attachments = {}
213+
end
211214
opts.attachments.img_name_func = opts.image_name_func
212215
opts.image_name_func = nil
213216
end

0 commit comments

Comments
 (0)