all repos — telegram-bot-api @ bd27dae5668234e3d6bc89e5256808efadd70dd4

Golang bindings for the Telegram Bot API

Fix nil pointer on User String method

(cherry picked from commit 74925cfcaf65580e42aa05296691424b181de85d)
maria.bagdasarova mbagdasarova@nvidia.com
Fri, 22 May 2020 11:42:19 +0300
commit

bd27dae5668234e3d6bc89e5256808efadd70dd4

parent

1bdfd4d5e666254d5aed00a2475b4c052f1eff34

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

jump to
M types.gotypes.go

@@ -69,6 +69,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 }