all repos — telegram-bot-api @ 2339ed4639a8e0a9701f624ffd299af00476daf2

Golang bindings for the Telegram Bot API

Merge pull request #338 from pachmu/master

Fix nil pointer on User String method
Kirill Zhuharev zhuharev@users.noreply.github.com
Sun, 24 May 2020 13:51:51 +0300
commit

2339ed4639a8e0a9701f624ffd299af00476daf2

parent

e680fa5288b4f37d1b01f57663bea2f7e51d9b77

1 files changed, 3 insertions(+), 0 deletions(-)

jump to
M types.gotypes.go

@@ -64,6 +64,9 @@ //

// It is normally a user's username, but falls back to a first/last // name as available. func (u *User) String() string { + if u == nil { + return "" + } if u.UserName != "" { return u.UserName }