IndexOutOfBoundsException in DHIS2 Capture App (Stock Management Module)

Dear DHIS2 Community,

I am reporting an issue on behalf of the International Committee of the Red Cross (ICRC) while using the DHIS2 Capture app with the stock management module. The error occurs when searching for items in the module. Below are the details:

java.lang.IndexOutOfBoundsException: Index 4 out of bounds for length 1
at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
at java.util.Objects.checkIndex(Objects.java:359)
at java.util.ArrayList.get(ArrayList.java:434)
at org.dhis2.composetable.model.TableModel.cellHasError(TableModel.kt:63)
at org.dhis2.composetable.ui.DataSetTableScreenKt.DataSetTableScreen(DataSetTableScreen.kt:129)
at org.dhis2.android.rtsm.ui.managestock.components.ManageStockTableKt$ManageStockTable$1$2.invoke(ManageStockTable.kt:153)

Steps to Reproduce:

  1. Open the DHIS2 Capture app.
  2. Navigate to the stock management module.
  3. Attempt to search for an item.
  4. The app crashes with the error above.

Environment:

  • DHIS2 Version: 2.40.5
  • Capture App Version: 3.0.1

I have attached a gif recording that captures the issue in detail.
Capture app

We would greatly appreciate your assistance or guidance in resolving this issue.

Thank you for your support!

Best regards,
Tafsir

cc @dhis2-android

Hi @diallotafsir52,

Thanks for reporting. We have this ticket ready to review, it will be fixed for the next patch release. :slight_smile:

1 Like