Fix bug in db.js::statementQuery() that prevented binding a single string parameter without putting it in an array
Also fixed array detection in flattenArguments() to handle a null value
This commit is contained in:
parent
cc726ef333
commit
b84181766d
2 changed files with 2 additions and 2 deletions
|
@ -172,7 +172,7 @@ Scholar.DB = new function(){
|
|||
|
||||
if (statement && params){
|
||||
// If single parameter, wrap in an array
|
||||
if (!params.length){
|
||||
if (typeof params != 'object' || params===null){
|
||||
params = [params];
|
||||
}
|
||||
|
||||
|
|
|
@ -306,7 +306,7 @@ var Scholar = new function(){
|
|||
*/
|
||||
function flattenArguments(args){
|
||||
// Put passed scalar values into an array
|
||||
if (typeof args!='object'){
|
||||
if (typeof args!='object' || args===null){
|
||||
args = [args];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue