You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deleting an account with subaccounts makes the application crash under certain conditions:
FATAL EXCEPTION: main
java.lang.IllegalArgumentException: accounts Record ID -9223372036854775808 does not exist in the db
at org.gnucash.android.db.DatabaseAdapter.getUID(DatabaseAdapter.java:426)
at org.gnucash.android.ui.account.DeleteAccountDialogFragment$4.onClick(DeleteAccountDialogFragment.java:221)
at android.view.View.performClick(View.java:2494)
at android.view.View$PerformClick.run(View.java:9105)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
at dalvik.system.NativeStart.main(Native Method)
Steps to reproduce with default accounts:
Enter "Assets" account.
Select "DELETE" from the "Current Assets" account's menu.
Press "Delete".
The application crashes.
The problem is due to the code in mOkButton.setOnClickListener(). The code under the condition mMoveTransactionsRadioButton.isChecked() is always executed, even when there aren't any transactions to move. This happens because, when the layout is loaded, mMoveTransactionsRadioButton is set to checked state.
The concrete condition under which the application crashes is when mTransactionsDestinationAccountSpinner doesn't have any item. Then, the call to mTransactionsDestinationAccountSpinner.getSelectedItemId() returns INVALID_ROW_ID (-9223372036854775808, see javadoc) and accountsDbAdapter.getUID(targetAccountId) fails.
I'm working on a fix.
The text was updated successfully, but these errors were encountered:
rivaldi8
added a commit
to rivaldi8/gnucash-android
that referenced
this issue
Jan 6, 2016
Deleting an account with subaccounts makes the application crash under certain conditions:
Steps to reproduce with default accounts:
The problem is due to the code in
mOkButton.setOnClickListener()
. The code under the conditionmMoveTransactionsRadioButton.isChecked()
is always executed, even when there aren't any transactions to move. This happens because, when the layout is loaded,mMoveTransactionsRadioButton
is set to checked state.The concrete condition under which the application crashes is when
mTransactionsDestinationAccountSpinner
doesn't have any item. Then, the call tomTransactionsDestinationAccountSpinner.getSelectedItemId()
returnsINVALID_ROW_ID
(-9223372036854775808, see javadoc) andaccountsDbAdapter.getUID(targetAccountId)
fails.I'm working on a fix.
The text was updated successfully, but these errors were encountered: