mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-04 00:14:55 +08:00
Fixing sef fault on bad XML #1888
This commit is contained in:
@@ -299,6 +299,10 @@ func (dec *xmlDecoder) decodeXML(root *xmlNode) error {
|
||||
log.Debug("chardata [%v] for %v", elem.n.Data, elem.label)
|
||||
}
|
||||
case xml.EndElement:
|
||||
if elem == nil {
|
||||
log.Debug("no element, probably bad xml")
|
||||
continue
|
||||
}
|
||||
log.Debug("end element %v", elem.label)
|
||||
elem.state = "finished"
|
||||
// And add it to its parent list
|
||||
|
||||
Reference in New Issue
Block a user