www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit bc18f42f81e92968b14d87e6eb9efea093cd5ae5
parent 3b119d4c6ed24bcfa7e344d6aa1f284348495418
Author: Dan Stillman <dstillman@zotero.org>
Date:   Tue, 27 Jun 2006 14:14:40 +0000

Fix issue with null values passed natively to DB query statements as bound statements


Diffstat:
Mchrome/chromeFiles/content/scholar/xpcom/db.js | 9++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/chrome/chromeFiles/content/scholar/xpcom/db.js b/chrome/chromeFiles/content/scholar/xpcom/db.js @@ -171,17 +171,17 @@ Scholar.DB = new function(){ if (statement && params){ for (var i=0; i<params.length; i++){ // Integer - if (typeof params[i]['int'] != 'undefined'){ + if (params[i]!==null && typeof params[i]['int'] != 'undefined'){ var type = 'int'; var value = params[i]['int']; } // String - else if (typeof params[i]['string'] != 'undefined'){ + else if (params[i]!==null && typeof params[i]['string'] != 'undefined'){ var type = 'string'; var value = params[i]['string']; } // Null - else if (typeof params[i]['null'] != 'undefined'){ + else if (params[i]!==null && typeof params[i]['null'] != 'undefined'){ var type = 'null'; } // Automatic (trust the JS type) @@ -195,8 +195,7 @@ Scholar.DB = new function(){ break; // Object default: - // Null value will show as object - if (!params[i]){ + if (params[i]===null){ var type = 'null'; } else {