fix(persistence): fix get revealed accounts when isAirdropAddress is nil (#3780)

This commit is contained in:
Jonathan Rainville 2023-07-19 15:23:00 -04:00 committed by GitHub
parent bbe35ce7fe
commit 12dc86fe1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -588,8 +588,8 @@ func (p *Persistence) GetRequestToJoinRevealedAddresses(requestID []byte) ([]*pr
for rows.Next() {
address := ""
chainIDsStr := ""
isAirDropAddress := false
err := rows.Scan(&address, &chainIDsStr, &isAirDropAddress)
var isAirdropAddress sql.NullBool
err := rows.Scan(&address, &chainIDsStr, &isAirdropAddress)
if err != nil {
return nil, err
}
@ -608,7 +608,10 @@ func (p *Persistence) GetRequestToJoinRevealedAddresses(requestID []byte) ([]*pr
revealedAccount := &protobuf.RevealedAccount{
Address: address,
ChainIds: chainIDs,
IsAirdropAddress: isAirDropAddress,
IsAirdropAddress: false,
}
if isAirdropAddress.Valid {
revealedAccount.IsAirdropAddress = isAirdropAddress.Bool
}
revealedAccounts = append(revealedAccounts, revealedAccount)
}