Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to invoke virtual method ‘java.lang.String.org.javarosa.core.model.SelectChoice.getTextID()’ on a null object reference #642

Closed
grzesiek2010 opened this issue Sep 2, 2021 · 0 comments · Fixed by #646
Assignees

Comments

@grzesiek2010
Copy link
Member

Software versions

JavaRosa v3.2.0

Problem description

The issue was originally reported on the forum:
https://forum.getodk.org/t/error-in-odk-collect-attempt-to-invoke-virtual-method-java-lang-string-org-javarosa-core-model-selectchoice-gettextid-on-a-null-object-reference/34916

Steps to reproduce the problem

  1. Open the attached form:
    dynamiChoices.xlsx
  2. Select any option and add another group
  3. Select any option (different than if the first group)
  4. Save the form.
  5. Edit the saved form
  6. Try to open the first group in the hierarchy view then navigate up in the hierarchy and try to open the second group

Other information

It's a regression that was introduced in Cache and reuse dynamic choice lists #619 #626

Logs:

2021-09-02 11:29:46.411 24578-24578/org.odk.collect.android E/FormHierarchyActivity: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.javarosa.core.model.SelectChoice.getTextID()' on a null object reference
        at org.javarosa.form.api.FormEntryPrompt.getSelectItemText(FormEntryPrompt.java:312)
        at org.javarosa.form.api.FormEntryPrompt.getAnswerText(FormEntryPrompt.java:163)
        at org.odk.collect.android.utilities.FormEntryPromptUtils.getAnswerText(FormEntryPromptUtils.java:119)
        at org.odk.collect.android.activities.FormHierarchyActivity.refreshView(FormHierarchyActivity.java:553)
        at org.odk.collect.android.activities.FormHierarchyActivity.refreshView(FormHierarchyActivity.java:480)
        at org.odk.collect.android.activities.FormHierarchyActivity.onElementClick(FormHierarchyActivity.java:706)
        at org.odk.collect.android.activities.FormHierarchyActivity$$ExternalSyntheticLambda3.onElementClick(Unknown Source:2)
        at org.odk.collect.android.adapters.HierarchyListAdapter$ViewHolder.lambda$bind$0(HierarchyListAdapter.java:85)
        at org.odk.collect.android.adapters.HierarchyListAdapter$ViewHolder$$ExternalSyntheticLambda0.onClick(Unknown Source:4)
        at android.view.View.performClick(View.java:7448)
        at android.view.View.performClickInternal(View.java:7425)
        at android.view.View.access$3600(View.java:810)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment