Skip to content

Commit

Permalink
Fix crash when scheduled service does not find transaction
Browse files Browse the repository at this point in the history
Fix crash when closing Accounts list
Update CHANGELOG for v2.2.2
  • Loading branch information
codinguser committed Sep 5, 2016
1 parent a3927c8 commit 57241e8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Change Log
===============================================================================
Version 2.1.1 *(2016-09-05)*
----------------------------
* Fixed: Bug cause crash during start-up for devices with no scheduled transactions

Version 2.1.0 *(2016-09-01)*
----------------------------
* Feature: Use multiple GnuCash books in single application
Expand All @@ -15,7 +19,9 @@ Version 2.1.0 *(2016-09-01)*
Version 2.0.7 *(2016-05-05)*
----------------------------
* Fixed: Currency exchange rate does not accept very small rates (> 2 decimal places)
* Improved: Updated translations for Japanese, Polish, French, Version 2.0.6 *(2016-02-20)*
* Improved: Updated translations for Japanese, Polish, French,

Version 2.0.6 *(2016-02-20)*
----------------------------
* Fixed: Saving transaction gets slower with increase in size of database
* Fixed: Imbalance amount wrongly computed in split editor (for some accounts)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,13 @@ private static int executeTransactions(ScheduledAction scheduledAction, SQLiteDa
int executionCount = 0;
String actionUID = scheduledAction.getActionUID();
TransactionsDbAdapter transactionsDbAdapter = new TransactionsDbAdapter(db, new SplitsDbAdapter(db));
Transaction trxnTemplate = transactionsDbAdapter.getRecord(actionUID);
Transaction trxnTemplate = null;
try {
trxnTemplate = transactionsDbAdapter.getRecord(actionUID);
} catch (IllegalArgumentException ex){ //if the record could not be found, abort
return executionCount;
}


long now = System.currentTimeMillis();
//if there is an end time in the past, we execute all schedules up to the end time.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,8 @@ public void onSaveInstanceState(Bundle outState) {
@Override
public void onDestroy() {
super.onDestroy();
mAccountRecyclerAdapter.swapCursor(null);
if (mAccountRecyclerAdapter != null)
mAccountRecyclerAdapter.swapCursor(null);
}

/**
Expand Down

0 comments on commit 57241e8

Please sign in to comment.