Skip to content

Commit

Permalink
Add missing lock
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Mar 19, 2024
1 parent 18372a0 commit 46bcca7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ func (cli *Client) handleDeviceNotification(node *waBinary.Node) {
}

func (cli *Client) handleFBDeviceNotification(node *waBinary.Node) {
cli.userDevicesCacheLock.Lock()
defer cli.userDevicesCacheLock.Unlock()
jid := node.AttrGetter().JID("from")
userDevices := parseFBDeviceList(jid, node.GetChildByTag("devices"))
cli.userDevicesCache[jid] = userDevices
Expand Down

0 comments on commit 46bcca7

Please sign in to comment.