Fix panic on receiving nil message at handleSyncKeypair

This commit is contained in:
Roman Volosovskyi 2023-05-26 18:37:40 +02:00
parent 963f9e3dbd
commit aded83fc6e
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
2 changed files with 4 additions and 1 deletions

View File

@ -1 +1 @@
0.152.2 0.152.3

View File

@ -2976,6 +2976,9 @@ func (m *Messenger) handleSyncWalletAccount(message *protobuf.SyncAccount, synce
} }
func (m *Messenger) handleSyncKeypair(message *protobuf.SyncKeypair) (*accounts.Keypair, error) { func (m *Messenger) handleSyncKeypair(message *protobuf.SyncKeypair) (*accounts.Keypair, error) {
if message == nil {
return nil, errors.New("handleSyncKeypair receive a nil message")
}
dbKeypair, err := m.settings.GetKeypairByKeyUID(message.KeyUid) dbKeypair, err := m.settings.GetKeypairByKeyUID(message.KeyUid)
if err != nil && err != accounts.ErrDbKeypairNotFound { if err != nil && err != accounts.ErrDbKeypairNotFound {
return nil, err return nil, err