Add nil check in method '(*Update).FromChat', for type CallbackQuery.

pull/9/head
OvyFlash 2023-07-11 12:04:24 +03:00
parent 3c3091bd33
commit dcd469ffa5
1 changed files with 1 additions and 1 deletions

View File

@ -158,7 +158,7 @@ func (u *Update) FromChat() *Chat {
return u.ChannelPost.Chat
case u.EditedChannelPost != nil:
return u.EditedChannelPost.Chat
case u.CallbackQuery != nil:
case u.CallbackQuery != nil && u.CallbackQuery.Message != nil:
return u.CallbackQuery.Message.Chat
default:
return nil