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

Panic when TOC rendering. #284

Closed
odknt opened this issue Feb 6, 2019 · 1 comment · Fixed by #285
Closed

Panic when TOC rendering. #284

odknt opened this issue Feb 6, 2019 · 1 comment · Fixed by #285
Assignees
Milestone

Comments

@odknt
Copy link
Contributor

odknt commented Feb 6, 2019

A content for reproduce in the following.

= sect0
:toc:

level 1 sections not exists.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x6bcdde]

goroutine 1 [running]:
github.com/bytesparadise/libasciidoc/pkg/renderer/html5.renderTableOfContents(0xc0001674a0, 0x739d80, 0x3074636573, 0x1, 0x1, 0xc0001c14b0)
        /go/src/github.com/bytesparadise/libasciidoc/pkg/renderer/html5/table_of_contents.go:56 +0x9e
github.com/bytesparadise/libasciidoc/pkg/renderer/html5.renderElement(0xc0001674a0, 0x731e20, 0xc215f0, 0x1, 0x1, 0xc05b40, 0x7f5f64039440, 0x0)
        /go/src/github.com/bytesparadise/libasciidoc/pkg/renderer/html5/renderer.go:79 +0x13ce
github.com/bytesparadise/libasciidoc/pkg/renderer/html5.renderElements(0xc0001674a0, 0xc0001d4120, 0x3, 0x3, 0x1, 0x5, 0x40, 0x0, 0x0)
        /go/src/github.com/bytesparadise/libasciidoc/pkg/renderer/html5/renderer.go:26 +0x124
github.com/bytesparadise/libasciidoc/pkg/renderer/html5.renderDocumentElements(0xc0001674a0, 0xc0001d40f0, 0xc0001d4120, 0x3, 0x3, 0xc0001d4150, 0xc215f0, 0x0, 0x0, 0xc0001d4180, ...)
        /go/src/github.com/bytesparadise/libasciidoc/pkg/renderer/html5/document.go:123 +0xe1
github.com/bytesparadise/libasciidoc/pkg/renderer/html5.renderDocument(0xc0001674a0, 0x7e5880, 0xc00009e008, 0x0, 0xc0001674a0, 0xc0001d41b0)
        /go/src/github.com/bytesparadise/libasciidoc/pkg/renderer/html5/document.go:96 +0x221
github.com/bytesparadise/libasciidoc/pkg/renderer/html5.Render(0xc0001674a0, 0x7e5880, 0xc00009e008, 0xc0001d4120, 0x3, 0x3)
        /go/src/github.com/bytesparadise/libasciidoc/pkg/renderer/html5/renderer.go:16 +0x3f
github.com/bytesparadise/libasciidoc.convertToHTML(0x7e6f40, 0xc00009a010, 0xc0001d40f0, 0xc0001d4120, 0x3, 0x3, 0xc0001d4150, 0xc215f0, 0x0, 0x0, ...)
        /go/src/github.com/bytesparadise/libasciidoc/libasciidoc.go:62 +0x105
github.com/bytesparadise/libasciidoc.ConvertToHTML(0x7e6f40, 0xc00009a010, 0x7e5860, 0xc00015a220, 0x7e5880, 0xc00009e008, 0xc0001c1c90, 0x1, 0x1, 0xc000127bc8, ...)
        /go/src/github.com/bytesparadise/libasciidoc/libasciidoc.go:57 +0x3d0
github.com/bytesparadise/libasciidoc.ConvertFileToHTML(0x7e6f40, 0xc00009a010, 0x7fff8a228b03, 0xe, 0x7e5880, 0xc00009e008, 0xc000127c90, 0x1, 0x1, 0x0, ...)
        /go/src/github.com/bytesparadise/libasciidoc/libasciidoc.go:37 +0x116
main.NewRootCmd.func1(0xc000198000, 0xc000163180, 0x1, 0x4, 0x0, 0x0)
        /go/src/github.com/bytesparadise/libasciidoc/cmd/libasciidoc/root_cmd.go:37 +0x295
github.com/spf13/cobra.(*Command).execute(0xc000198000, 0xc0000a4010, 0x4, 0x4, 0xc000198000, 0xc0000a4010)
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:762 +0x473
github.com/spf13/cobra.(*Command).ExecuteC(0xc000198000, 0x1, 0x0, 0xc000198280)
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:852 +0x2fd
github.com/spf13/cobra.(*Command).Execute(0xc000198000, 0xc000127f70, 0x1)
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:800 +0x2b
main.main()
        /go/src/github.com/bytesparadise/libasciidoc/cmd/libasciidoc/main.go:17 +0x97
@xcoulon
Copy link
Member

xcoulon commented Feb 6, 2019

thanks for reporting this issue @odknt. I'll take care of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants