summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu Cheng-Han2017-03-15 22:12:24 +0800
committerWu Cheng-Han2017-03-15 22:12:24 +0800
commit4a1d08c653070e856bceb1bc4a7d8ff7ab1aa203 (patch)
treef45612b698cc5965702dce6abd1cebbba51c795d
parentf55a4b8497ad3e21637769f9de7e600a40dd1189 (diff)
Fix strip null byte in model should cast to string to use replace function
-rw-r--r--lib/models/index.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/models/index.js b/lib/models/index.js
index a378ee67..95f900b6 100644
--- a/lib/models/index.js
+++ b/lib/models/index.js
@@ -23,6 +23,7 @@ if (config.dburl) {
// [Postgres] Handling NULL bytes
// https://github.com/sequelize/sequelize/issues/6485
function stripNullByte (value) {
+ value = '' + value
return value ? value.replace(/\u0000/g, '') : value
}
sequelize.stripNullByte = stripNullByte