antchfx / xmlquery

xmlquery is Golang XPath package for XML query.
https://github.com/antchfx/xpath
MIT License
444 stars 89 forks source link

nil pointer dereference at parse.go:145 #75

Closed hokumski closed 2 years ago

hokumski commented 2 years ago

Hi!

There's possible "nil pointer dereference" error at line 145 of parse.go, p.prev could be nil

AddSibling(p.prev.Parent, node)

(I have XML file causing this error)

zhengchun commented 2 years ago

@hokumski , Please provide your XML file.

hokumski commented 2 years ago

v1.3.8

parsed, err := xmlquery.Parse(strings.NewReader(string(xmlDataBytes)))

publication-6430.xml.zip

zhengchun commented 2 years ago

v1.3.9 to fix