all repos — telegram-bot-api @ 74925cfcaf65580e42aa05296691424b181de85d

Golang bindings for the Telegram Bot API

Fix nil pointer on User String method
maria.bagdasarova mbagdasarova@nvidia.com
Fri, 22 May 2020 11:42:19 +0300
commit

74925cfcaf65580e42aa05296691424b181de85d

parent

5e339ed016b0c7349c092f9fc0ecdf9e18c5f963

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 }