diff options
| -rw-r--r-- | hotline/transaction_handlers.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/hotline/transaction_handlers.go b/hotline/transaction_handlers.go index 7f29d73..26eee12 100644 --- a/hotline/transaction_handlers.go +++ b/hotline/transaction_handlers.go @@ -1782,7 +1782,10 @@ func HandleLeaveChat(cc *ClientConn, t *Transaction) (res []Transaction, err err chatID := t.GetField(fieldChatID).Data chatInt := binary.BigEndian.Uint32(chatID) - privChat := cc.Server.PrivateChats[chatInt] + privChat, ok := cc.Server.PrivateChats[chatInt] + if !ok { + return res, nil + } delete(privChat.ClientConn, cc.uint16ID()) |