evernote2md.exe invalid memory address or nil pointer dereference on conversion of note
cverbiest opened this issue · 3 comments
Problem statement
I'm able to convert notes but on one particular note the conversion crashes.
Attached export file Evernote6.zip
evernote2md.exe Evernote6.enex evout
Notes: 0 / 1 [_______________________________________________________________________________________________________________________________________] 0.00% 0spanic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x30 pc=0x5b94fa]
goroutine 1 [running]:
github.com/wormi4ok/evernote2md/internal.(*ExtraDiv).ReplaceTag(0x7fa9d0, 0xc000192e70)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:153 +0x4a
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc000192e70)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:28 +0x78
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc000198700)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc000192c40)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc000192bd0)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc000192af0)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc000192a10)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc000192930)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc000192700)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc0001f6850)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc0000fa380)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc0000fa310)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc0000fa2a0)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc0000fa1c0)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML.func1(0xc0000fa0e0)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:31 +0xab
github.com/wormi4ok/evernote2md/internal.normalizeHTML(0xc000300000, 0x11507, 0x207ff, 0xc0000bbde8, 0x3, 0x3, 0x0, 0x390000c000112c30, 0x0, 0x39a7139b39783d9e, ...)
/home/runner/work/evernote2md/evernote2md/internal/replace.go:34 +0x13f
github.com/wormi4ok/evernote2md/internal.(*Converter).Convert(0xc0000bbe77, 0xc000168160, 0x4e, 0xc0002cc000, 0x0)
/home/runner/work/evernote2md/evernote2md/internal/convert.go:29 +0x1b0
main.run(0xc0000a00a0, 0xe, 0xc0000a00b8, 0x5, 0x100)
/home/runner/work/evernote2md/evernote2md/main.go:81 +0x2f4
main.main()
/home/runner/work/evernote2md/evernote2md/main.go:54 +0x40f
Hi @cverbiest!
Thanks a lot for reporting the problem. I released a patch, you can try to convert the note using the latest v0.10.1.
I checked it on the example you attached and it doesn't crash anymore. The result is still not satisfying, I would say. The original note contains an HTML page with a table-based layout, that makes Markdown go crazy. But I don't think there is much I can do here.
The new version no longer crashes on this note. I had isolated this note from a larger export file containing 384 notes.
The conversion of the full file still fails but it does not crash. I'll start a new issue