Add nil check for DirectMessageProtocol object

This commit is contained in:
Vitaliy Vlasov 2021-12-02 13:55:30 +02:00 committed by Vitaliy Vlasov
parent 268c8304a1
commit ea95ce2d4b

View File

@ -477,6 +477,7 @@ func (p *Protocol) HandleMessage(
if dmProtocol == nil {
dmProtocol = encryptedMessage[noInstallationID]
}
if dmProtocol != nil {
hrHeader := dmProtocol.HRHeader
if hrHeader != nil && hrHeader.SeqNo == 0 {
// Payload contains hash ratchet key
@ -485,6 +486,7 @@ func (p *Protocol) HandleMessage(
return nil, err
}
}
}
bundles := protocolMessage.GetBundles()
version := getProtocolVersion(bundles, protocolMessage.GetInstallationId())