bitpay / bitpay-go

Powerful, flexible, lightweight interface to the BitPay Bitcoin Payment Gateway API.
MIT License
33 stars 27 forks source link

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

Open braydonf opened 8 years ago

braydonf commented 8 years ago

An runtime error will happen with untrusted X.509 certificates:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x458589]

goroutine 1 [running]:
github.com/bitpay/bitpay-go/client.(*Client).PairClient(0xc208078120, 0xc20803bb90, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /home/testuser/go/src/github.com/bitpay/bitpay-go/client/client.go:114 +0x5e9
github.com/bitpay/bitpay-go/client.(*Client).PairWithCode(0xc208078120, 0x719690, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /home/testuser/go/src/github.com/bitpay/bitpay-go/client/client.go:98 +0x233
main.main()
    /home/testuser/testing/go-client/test.go:17 +0x26c

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1
exit status 2
Athitaya253 commented 6 years ago

เช็ค

themihai commented 5 years ago

the library is not handling the errors ...so it's expected to panic...