Skip to content

Commit

Permalink
null character fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gobicycle committed Aug 28, 2024
1 parent e187ba7 commit 31deaf8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/xssnick/tonutils-go/address"
"github.com/xssnick/tonutils-go/ton"
"github.com/xssnick/tonutils-go/ton/wallet"
"strings"
"sync"
"time"
)
Expand Down Expand Up @@ -308,6 +309,7 @@ func (c *Connection) LoadAddressBook(ctx context.Context) error {
}

func saveExternalIncome(ctx context.Context, tx pgx.Tx, inc core.ExternalIncome) error {
inc.Comment = strings.Replace(inc.Comment, "\x00", "", -1) // PostgreSQL doesn't support storing NULL (\0x00) characters in text fields
_, err := tx.Exec(ctx, `
INSERT INTO payments.external_incomes (
lt,
Expand Down

0 comments on commit 31deaf8

Please sign in to comment.