不要怂,就是干,撸起袖子干!

Commit d896c77a by sdepold

fixed null case in escape method for sqlite

1 parent 608955df
...@@ -2,10 +2,12 @@ var Utils = require("../../utils") ...@@ -2,10 +2,12 @@ var Utils = require("../../utils")
, util = require("util") , util = require("util")
var escape = function(str) { var escape = function(str) {
if (typeof str == 'string') { if (typeof str === 'string') {
return "'" + str.replace(/'/g, "''") + "'"; return "'" + str.replace(/'/g, "''") + "'"
} else if(str === null) {
return 'NULL'
} else { } else {
return str; return str
} }
}; };
......
...@@ -46,6 +46,9 @@ describe('DAO@sqlite', function() { ...@@ -46,6 +46,9 @@ describe('DAO@sqlite', function() {
}) })
}) })
}) })
.error(function(err) {
console.log(err)
})
}) })
}) })
}) })
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!