forked from Silverfish/proton-bridge
fix(GODT-2618): Crash when address does not have unlocked keyring
This commit is contained in:
@ -513,7 +513,16 @@ func (user *User) syncMessages(
|
||||
result, err := parallel.MapContext(ctx, maxMessagesInParallel, chunk, func(ctx context.Context, msg proton.FullMessage) (*buildRes, error) {
|
||||
defer async.HandlePanic(user.panicHandler)
|
||||
|
||||
return buildRFC822(apiLabels, msg, addrKRs[msg.AddressID], new(bytes.Buffer)), nil
|
||||
kr, ok := addrKRs[msg.AddressID]
|
||||
if !ok {
|
||||
return &buildRes{
|
||||
messageID: msg.ID,
|
||||
addressID: msg.AddressID,
|
||||
err: fmt.Errorf("address does not have an unlocked keyring"),
|
||||
}, nil
|
||||
}
|
||||
|
||||
return buildRFC822(apiLabels, msg, kr, new(bytes.Buffer)), nil
|
||||
})
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user