Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 121c63d

Browse files
committed
bugfix
1 parent 343b6ea commit 121c63d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/logic/book.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,14 @@ func (this *book) DelUser(user, serverId int, isUid bool) {
165165
this.rwMutex.Lock()
166166
defer this.rwMutex.Unlock()
167167

168+
// 已经不存在了
169+
if _, ok := this.users[user]; !ok {
170+
if isUid {
171+
delete(this.uids, user)
172+
}
173+
return
174+
}
175+
168176
// 自己只有一个页面建立websocket连接
169177
if this.users[user].Len() == 1 {
170178
delete(this.users, user)

0 commit comments

Comments
 (0)