Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid nil pointer panic (thread save) #51

Merged
merged 1 commit into from
Jun 14, 2020

Conversation

d-g-laptev
Copy link
Contributor

Issue #43 didn't fix problem
I got panic:

	runtime error: invalid memory address or nil pointer dereference
	goroutine 19231 [running]:
	******
	panic(0x1c60160, 0x29801c0)
		/usr/local/Cellar/go/1.13.4/libexec/src/runtime/panic.go:679 +0x1b2
	github.com/antchfx/xpath.(*attributeQuery).Select(0xc0019bba20, 0x201ee00, 0xc0087c4a40, 0x2034f40, 0xc0019bba20)
		/Users/d.laptev/Dev/go/pkg/mod/github.com/antchfx/xpath@v1.1.8/query.go:147 +0x2f
	github.com/antchfx/xpath.normalizespaceFunc(0x2034f40, 0xc0019bba20, 0x201ee00, 0xc0087c4a40, 0xc0048fc350, 0xc0048fc350)
		/Users/d.laptev/Dev/go/pkg/mod/github.com/antchfx/xpath@v1.1.8/func.go:354 +0x444

Panic didn't happen when i disable cache in htmlquery

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 75.814% when pulling 44e7a6b on d-g-laptev:fix_panic into 51d8936 on antchfx:master.

@zhengchun zhengchun merged commit 31b43ad into antchfx:master Jun 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants