Skip to content

Commit

Permalink
fix(SPV-1284): add safe checks if fullName is whitespace only
Browse files Browse the repository at this point in the history
  • Loading branch information
wregulski committed Dec 12, 2024
1 parent 66e0aa3 commit 1f283b0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions engine/action_contact.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package engine
import (
"context"
"fmt"
"strings"

"github.com/bitcoin-sv/go-paymail"
"github.com/bitcoin-sv/spv-wallet/engine/datastore"
Expand Down Expand Up @@ -225,11 +226,11 @@ func (c *Client) AdminCreateContact(ctx context.Context, contactPaymail, creator
}

func validateNewContactReqFields(fullName, creatorPaymail string) error {
if fullName == "" {
if strings.TrimSpace(fullName) == "" {
return spverrors.ErrMissingContactFullName
}

if creatorPaymail == "" {
if strings.TrimSpace(creatorPaymail) == "" {
return spverrors.ErrMissingContactCreatorPaymail
}

Expand Down

0 comments on commit 1f283b0

Please sign in to comment.