fix: fixed the panic when getting nil chat.
This commit is contained in:
parent
638b1c1f78
commit
6940150f31
1 changed files with 8 additions and 1 deletions
9
bot.go
9
bot.go
|
@ -200,7 +200,14 @@ func (bot *Bot) Run() error {
|
||||||
u := &Update{
|
u := &Update{
|
||||||
Update: &up,
|
Update: &up,
|
||||||
}
|
}
|
||||||
chn, ok := handles[u.FromChat().Type]
|
|
||||||
|
// Sometimes returns nil.
|
||||||
|
fromChat := u.FromChat()
|
||||||
|
if fromChat == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
chn, ok := handles[fromChat.Type]
|
||||||
if !ok {
|
if !ok {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue