openMF / mifos-mobile

Repository for the Mifos Mobile Banking App for clients
https://openmf.github.io/mobileapps.github.io/
Mozilla Public License 2.0
274 stars 686 forks source link

Bug: App crash when clicking an account with any amount as null #2556

Closed AbrahamOsmondE closed 6 months ago

AbrahamOsmondE commented 6 months ago

Summary:

When clicking an account with any one of the amount as null, the mifos mobile app crashes

Steps to reproduce:

  1. Go to home page
  2. Find an account with a null withdrawal amount and click

Expected behaviour:

The app should display the amount as "0.0" instead of null

Observed behaviour:

The app crashes instead

Demo Video:

https://github.com/openMF/mifos-mobile/assets/82792334/6aa7cb2f-5300-4d07-ae73-95715952f736

AbrahamOsmondE commented 6 months ago

Error related to the crash:

User
2024-03-29 00:32:04.806 20391-20391 AndroidRuntime          org.mifos.mobile                     E  FATAL EXCEPTION: main
                                                                                                    Process: org.mifos.mobile, PID: 20391
                                                                                                    java.lang.IllegalArgumentException: Cannot format given Object as a Number
                                                                                                        at java.text.DecimalFormat.format(DecimalFormat.java:652)
                                                                                                        at java.text.Format.format(Format.java:159)
                                                                                                        at org.mifos.mobile.utils.CurrencyUtil.formatCurrency(CurrencyUtil.kt:24)
                                                                                                        at org.mifos.mobile.ui.savings_account.SavingsAccountDetailContentKt$AccountDetailsCard$1.invoke(SavingsAccountDetailContent.kt:178)
                                                                                                        at org.mifos.mobile.ui.savings_account.SavingsAccountDetailContentKt$AccountDetailsCard$1.invoke(SavingsAccountDetailContent.kt:109)
                                                                                                        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:117)
                                                                                                        at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)

format the above