optimization - we don't want to call back into the js if the query had no callback

This commit is contained in:
Mike 2012-04-08 12:02:24 -04:00
parent b500b78408
commit adeebc1173
2 changed files with 5 additions and 5 deletions

View File

@ -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];

View File

@ -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 + ");");
}
}