fixed crash in json-rpc mode

* protect map access with mutex

see #885
This commit is contained in:
Bernhard B 2026-09-26 21:33:47 +02:00
parent 74253a3a41
commit 80e0f34032

View File

@ -262,7 +262,10 @@ func (r *JsonRpc2Client) ReceiveData(number string, receiveWebhookUrl string) {
err = json.Unmarshal([]byte(str), &resp2)
if err == nil {
if resp2.Id != "" {
if responseChan, ok := r.receivedResponsesById[resp2.Id]; ok {
r.receivedResponsesMutex.Lock()
responseChan, ok := r.receivedResponsesById[resp2.Id]
r.receivedResponsesMutex.Unlock()
if ok {
responseChan <- resp2
}
}