soup
soup copied to clipboard
Fix for `invalid memory address or nil pointer dereference`
Error log:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x796022]
goroutine XXXX [running]:
github.com/anaskhan96/soup.Root.Text({0x0, {0x0, 0x0}, {0x8efd40, 0xc0b11e8a08}})
/root/go/pkg/mod/github.com/anaskhan96/[email protected]/soup.go:415 +0x42
This error seems to be happening when running thousands(+) of goroutines that are interacting with the library. This quick patch that I've applied seems to be fixing it and avoids the entire program from panicking.