Skip to content

Commit 4a1d08c

Browse files
committed
Fix strip null byte in model should cast to string to use replace function
1 parent f55a4b8 commit 4a1d08c

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

lib/models/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ if (config.dburl) {
2323
// [Postgres] Handling NULL bytes
2424
// https://github.com/sequelize/sequelize/issues/6485
2525
function stripNullByte (value) {
26+
value = '' + value
2627
return value ? value.replace(/\u0000/g, '') : value
2728
}
2829
sequelize.stripNullByte = stripNullByte

0 commit comments

Comments
 (0)