Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x96f422] When we handle webhooks from viber, we create instance by this way: v := &viber.Viber{ AppKey: token, Sender: viber.Sender{ Name: "MyPage", Avatar: "https://mysite.com/img/avatar.jpg", }, //Message: msgReceivedFunc, //Delivered: deliveredFunc, } May be this is bad way, and we need to use .New() method everywhere, beause v.client is nil. My fix: just check and init &http.Client{} if client is nil.
- Loading branch information