diff --git a/Android/SQLitePlugin/assets/www/SQLitePlugin.js b/Android/SQLitePlugin/assets/www/SQLitePlugin.js index 770e501..f307186 100755 --- a/Android/SQLitePlugin/assets/www/SQLitePlugin.js +++ b/Android/SQLitePlugin/assets/www/SQLitePlugin.js @@ -114,7 +114,7 @@ if(typeof transId != 'undefined') { console.log("SQLitePluginTransaction.txCompleteCallback---transId:"+transId); - if(transId && transaction_callback_queue[transId]['success']) + if(transId && transaction_callback_queue[transId] && transaction_callback_queue[transId]['success']) transaction_callback_queue[transId]['success'](); delete transaction_queue[transId]; diff --git a/Android/SQLitePlugin/src/com/phonegap/plugins/sqlitePlugin/SQLitePlugin.java b/Android/SQLitePlugin/src/com/phonegap/plugins/sqlitePlugin/SQLitePlugin.java index 76d3d53..c163920 100755 --- a/Android/SQLitePlugin/src/com/phonegap/plugins/sqlitePlugin/SQLitePlugin.java +++ b/Android/SQLitePlugin/src/com/phonegap/plugins/sqlitePlugin/SQLitePlugin.java @@ -186,8 +186,8 @@ public class SQLitePlugin extends Plugin { params = paramsarr[i]; query_id = queryIDs[i]; Cursor myCursor = this.myDb.rawQuery(query, params); - if(query_id != "") - this.processResults(myCursor, query_id, tx_id); + + this.processResults(myCursor, query_id, tx_id); myCursor.close(); } this.myDb.setTransactionSuccessful(); @@ -242,8 +242,8 @@ public class SQLitePlugin extends Plugin { result = fullresult.toString(); } - - this.sendJavascript(" SQLitePluginTransaction.queryCompleteCallback('" + tx_id + "','" + query_id + "', " + result + ");"); + if(query_id.length() > 0) + this.sendJavascript(" SQLitePluginTransaction.queryCompleteCallback('" + tx_id + "','" + query_id + "', " + result + ");"); } }