Skip to content

Commit e965cf6

Browse files
Merge branch 'Dharmey747/soupnilfix'
anaskhan96#83
2 parents 6dcd1c7 + 5167b19 commit e965cf6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

soup.go

+8
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,14 @@ func (r Root) Attrs() map[string]string {
413413

414414
// Text returns the string inside a non-nested element
415415
func (r Root) Text() string {
416+
if r.Pointer == nil {
417+
if debug {
418+
panic("Pointer text node is nil")
419+
}
420+
421+
return ""
422+
}
423+
416424
k := r.Pointer.FirstChild
417425
checkNode:
418426
if k != nil && k.Type != html.TextNode {

0 commit comments

Comments
 (0)