Skip to content

Commit 1f283b0

Browse files
committed
fix(SPV-1284): add safe checks if fullName is whitespace only
1 parent 66e0aa3 commit 1f283b0

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

engine/action_contact.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package engine
33
import (
44
"context"
55
"fmt"
6+
"strings"
67

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

227228
func validateNewContactReqFields(fullName, creatorPaymail string) error {
228-
if fullName == "" {
229+
if strings.TrimSpace(fullName) == "" {
229230
return spverrors.ErrMissingContactFullName
230231
}
231232

232-
if creatorPaymail == "" {
233+
if strings.TrimSpace(creatorPaymail) == "" {
233234
return spverrors.ErrMissingContactCreatorPaymail
234235
}
235236

0 commit comments

Comments
 (0)