Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

use example NewBotDetector panic #1

Open
bobzh39 opened this issue Oct 19, 2023 · 0 comments
Open

use example NewBotDetector panic #1

bobzh39 opened this issue Oct 19, 2023 · 0 comments

Comments

@bobzh39
Copy link

bobzh39 commented Oct 19, 2023

userAgent := "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36"
	detector, err := devicedetector.NewBotDetector(devicedetector.DeviceDetectorOptions{})
	if err != nil {
		panic(err)
	}
	result, err := detector.Parse(userAgent)
	if err != nil {
		panic(err)
	}

	fmt.Printf("%s\n", result)

panic: TypeError: Cannot convert undefined or null to object

goroutine 1 [running]:
rogchap.com/v8go.(*Value).Object(0xc000098110)
/Users/-/go/pkg/mod/rogchap.com/[email protected]/value.go:235 +0xc6
github.com/umutbasal/device-detector-go.NewBotDetector.func1({0x100f4e553, 0x89})
/Users/-/go/pkg/mod/github.com/umutbasal/[email protected]/device-detector.go:89 +0xfb
main.main()
/Users/.../main.go:16 +0x3d

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant