joeguo / tldextract

Extract root domain, subdomain name, and tld from a url, using the Public Suffix List.
MIT License
120 stars 29 forks source link

panic: runtime error: invalid memory address or nil pointer dereference #21

Open do0rito0x opened 2 years ago

do0rito0x commented 2 years ago

Hello When I run the program, it gives me this error

**``` panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x8 pc=0x6c2204]

goroutine 1 [running]: github.com/joeguo/tldextract.(*TLDExtract).getTldIndex(0xc00000a0c0?, {0xc0000ee030, 0x7221b2?, 0x1?}) C:/Users/Jorjjji/go/pkg/mod/github.com/joeguo/tldextract@v0.0.0-20220507100122-d83daa6adef8/tldextract.go:172 +0x64

elliotwutingfeng commented 2 years ago

I'm getting the exact same error on Windows 10 32-bit (MINGW32), but not on Linux 64-bit. It appears that ioutil.WriteFile is failing to create tld.cache on Windows.

imfht commented 1 year ago

I run into the same error. I think it's caused by network error. the programmer would download suffix data from https://publicsuffix.org/list/public_suffix_list.dat maybe you can check if there is any network issue to publicsuffix.org