From 1f283b07770dae8e41447befa94484e164b90e00 Mon Sep 17 00:00:00 2001 From: wregulski Date: Thu, 12 Dec 2024 18:18:33 +0100 Subject: [PATCH] fix(SPV-1284): add safe checks if fullName is whitespace only --- engine/action_contact.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/action_contact.go b/engine/action_contact.go index fa62a9f1d..de08b30d7 100644 --- a/engine/action_contact.go +++ b/engine/action_contact.go @@ -3,6 +3,7 @@ package engine import ( "context" "fmt" + "strings" "github.com/bitcoin-sv/go-paymail" "github.com/bitcoin-sv/spv-wallet/engine/datastore" @@ -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 }