yosssi/ace

panic when using new Indent option

mmindenhall opened this issue · 0 comments

I just updated my vendored version of ace to the latest commit, and tried out the Indent option. For my site, I saw a panic when using the option due to a nil action.parent attribute. Adding a nil check as follows fixed this for me locally:

action.go:33:

func (e *action) IsBlockElement() bool {
    if e.parent != nil {
        return e.parent.IsBlockElement()
    }
    return false
}

I'm not sure whether the default should be to return true instead when the parent is nil, but this solved the issue for me at hand, which was the panic.