Skip to content

Commit 46bcca7

Browse files
committed
Add missing lock
1 parent 18372a0 commit 46bcca7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

notification.go

+2
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ func (cli *Client) handleDeviceNotification(node *waBinary.Node) {
138138
}
139139

140140
func (cli *Client) handleFBDeviceNotification(node *waBinary.Node) {
141+
cli.userDevicesCacheLock.Lock()
142+
defer cli.userDevicesCacheLock.Unlock()
141143
jid := node.AttrGetter().JID("from")
142144
userDevices := parseFBDeviceList(jid, node.GetChildByTag("devices"))
143145
cli.userDevicesCache[jid] = userDevices

0 commit comments

Comments
 (0)