{"action":"opened","issue":{"url":"https://api.github.com/repos/codinguser/gnucash-android/issues/505","repository_url":"https://api.github.com/repos/codinguser/gnucash-android","labels_url":"https://api.github.com/repos/codinguser/gnucash-android/issues/505/labels{/name}","comments_url":"https://api.github.com/repos/codinguser/gnucash-android/issues/505/comments","events_url":"https://api.github.com/repos/codinguser/gnucash-android/issues/505/events","html_url":"https://github.com/codinguser/gnucash-android/issues/505","id":156322241,"number":505,"title":"NullPointerException on empty value in currency-converted amount","user":{"login":"rivaldi8","id":1187977,"avatar_url":"https://avatars.githubusercontent.com/u/1187977?v=3","gravatar_id":"","url":"https://api.github.com/users/rivaldi8","html_url":"https://github.com/rivaldi8","followers_url":"https://api.github.com/users/rivaldi8/followers","following_url":"https://api.github.com/users/rivaldi8/following{/other_user}","gists_url":"https://api.github.com/users/rivaldi8/gists{/gist_id}","starred_url":"https://api.github.com/users/rivaldi8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rivaldi8/subscriptions","organizations_url":"https://api.github.com/users/rivaldi8/orgs","repos_url":"https://api.github.com/users/rivaldi8/repos","events_url":"https://api.github.com/users/rivaldi8/events{/privacy}","received_events_url":"https://api.github.com/users/rivaldi8/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-23T17:29:24Z","updated_at":"2016-05-23T17:34:11Z","closed_at":null,"body":"If no value is entered in the converted amount text box in the \"Transfer funds\" dialog, the application crashes with a `NullPointerException`:\r\n\r\n```\r\njava.lang.NullPointerException: Attempt to invoke virtual method 'java.math.BigDecimal java.math.BigDecimal.setScale(int, java.math.RoundingMode)' on a null object reference\r\n  at org.gnucash.android.model.Money.setAmount(Money.java:333)\r\n  at org.gnucash.android.model.Money.<init>(Money.java:116)\r\n  at org.gnucash.android.ui.transaction.dialog.TransferFundsDialogFragment.transferFunds(TransferFundsDialogFragment.java:226)\r\n  at org.gnucash.android.ui.transaction.dialog.TransferFundsDialogFragment.access$100(TransferFundsDialogFragment.java:60)\r\n  at org.gnucash.android.ui.transaction.dialog.TransferFundsDialogFragment$5.onClick(TransferFundsDialogFragment.java:180)\r\n  at android.view.View.performClick(View.java:4802)\r\n  at android.view.View$PerformClick.run(View.java:20101)\r\n  at android.os.Handler.handleCallback(Handler.java:810)\r\n  at android.os.Handler.dispatchMessage(Handler.java:99)\r\n  at android.os.Looper.loop(Looper.java:189)\r\n  at android.app.ActivityThread.main(ActivityThread.java:5532)\r\n  at java.lang.reflect.Method.invoke(Native Method)\r\n  at java.lang.reflect.Method.invoke(Method.java:372)\r\n  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950)\r\n  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)\r\n```\r\n\r\nSteps to reproduce:\r\n\r\n1. Create a new account with a different currency than the one configured.\r\n2. Create a new transaction in some other account.\r\n3. Enter a description and an amount.\r\n3. Select the previously created account as transfer account. The transfer funds dialog will open.\r\n4. Select \"Converted Amount\".\r\n5. Delete any value in the text box leaving it empty.\r\n6. Press \"Save\".\r\n7. The application crashes.\r\n\r\nReceived as Crashlytics issue [#205](https://fabric.io/gnucash/android/apps/org.gnucash.android/issues/57362770ffcdc04250cbc039)."}}
{"actor":{"display_login":"rivaldi8"}}