Skip to content

Commit

Permalink
Fixed: crash when changing an account name
Browse files Browse the repository at this point in the history
  • Loading branch information
codinguser committed Feb 19, 2015
1 parent 6073a91 commit f8260b6
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -560,11 +560,12 @@ private void loadParentAccountList(AccountType accountType){
if (mAccount != null){ //if editing an account
mDescendantAccountUIDs = mAccountsDbAdapter.getDescendantAccountUIDs(mAccount.getUID(), null, null);
String rootAccountUID = mAccountsDbAdapter.getGnuCashRootAccountUID();
List<String> descendantAccountUIDs = new ArrayList<String>(mDescendantAccountUIDs);
if (rootAccountUID != null)
mDescendantAccountUIDs.add(rootAccountUID);
descendantAccountUIDs.add(rootAccountUID);
// limit cyclic account hierarchies.
condition += " AND (" + DatabaseSchema.AccountEntry.COLUMN_UID + " NOT IN ( '"
+ TextUtils.join("','", mDescendantAccountUIDs) + "','" + mAccountUID + "' ) )";
+ TextUtils.join("','", descendantAccountUIDs) + "','" + mAccountUID + "' ) )";
}

//if we are reloading the list, close the previous cursor first
Expand Down

0 comments on commit f8260b6

Please sign in to comment.