Skip to content

Commit f8260b6

Browse files
committed
Fixed: crash when changing an account name
1 parent 6073a91 commit f8260b6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/src/main/java/org/gnucash/android/ui/account/AccountFormFragment.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,11 +560,12 @@ private void loadParentAccountList(AccountType accountType){
560560
if (mAccount != null){ //if editing an account
561561
mDescendantAccountUIDs = mAccountsDbAdapter.getDescendantAccountUIDs(mAccount.getUID(), null, null);
562562
String rootAccountUID = mAccountsDbAdapter.getGnuCashRootAccountUID();
563+
List<String> descendantAccountUIDs = new ArrayList<String>(mDescendantAccountUIDs);
563564
if (rootAccountUID != null)
564-
mDescendantAccountUIDs.add(rootAccountUID);
565+
descendantAccountUIDs.add(rootAccountUID);
565566
// limit cyclic account hierarchies.
566567
condition += " AND (" + DatabaseSchema.AccountEntry.COLUMN_UID + " NOT IN ( '"
567-
+ TextUtils.join("','", mDescendantAccountUIDs) + "','" + mAccountUID + "' ) )";
568+
+ TextUtils.join("','", descendantAccountUIDs) + "','" + mAccountUID + "' ) )";
568569
}
569570

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

0 commit comments

Comments
 (0)