From 12dc86fe1b570b0cbe0ada5960f1d07aa147d763 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 19 Jul 2023 15:23:00 -0400 Subject: [PATCH] fix(persistence): fix get revealed accounts when isAirdropAddress is nil (#3780) --- protocol/communities/persistence.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/protocol/communities/persistence.go b/protocol/communities/persistence.go index 2a5d4da9a..0f38b860b 100644 --- a/protocol/communities/persistence.go +++ b/protocol/communities/persistence.go @@ -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) }