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
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List org.odk.collect.entities.javarosa.parse.EntityFormExtra.getSaveTos()' on a null object reference
at org.odk.collect.entities.javarosa.finalization.EntityFormFinalizationProcessor.processForm(EntityFormFinalizationProcessor.java:31)
at org.javarosa.form.api.FormEntryController.lambda$finalizeFormEntry$0$org-javarosa-form-api-FormEntryController(FormEntryController.java:210)
at org.javarosa.form.api.FormEntryController$$ExternalSyntheticLambda0.accept(Unknown Source:4)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1642)
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:606)
at org.javarosa.form.api.FormEntryController.finalizeFormEntry(FormEntryController.java:209)
at org.odk.collect.android.javarosawrapper.JavaRosaFormController.finalizeForm(JavaRosaFormController.java:285)
Steps to reproduce the problem
Install Collect v2024.2.1.
Download the All question types form from the demo server.
Open the form and close it.
Install v2024.3.0-beta.0 or the current master branch.
Open the All question types form and finalize it.
Expected behavior
There should be no crash.
What's going on?
The problem is that entityFormExtra is null after trying to read it from formDef
Then in the line below we try to use that object and get NPE.
But how null is returned instead of the expected entityFormExtra?
First of all, we need to keep in mind that we cache FormDef after opening a form for the first time. That''s what happened in the third step (see above). The cached FormDef contains extras as well.
Ok so now let's understand how we save/read extras. We do that using HashMap where the key is the class name (the fully qualified name of the class):
So in the third step using v2024.2.1 we save entityFormExtra with the key: org.javarosa.entities.internal.EntityFormExtra.
However, then we decided that EntityFormExtra class along with its whole package should be moved from Javarosa to Collect what was implemented in #6236 and became a part of v2024.3.0-beta.0.
As a result, if we now try to load such extras from cache we try to read them using org.odk.collect.entities.javarosa.parse.EntityFormExtra and get null because they exist but are stored with the old class name as a key org.javarosa.entities.internal.EntityFormExtra.
The text was updated successfully, but these errors were encountered:
ODK Collect version
v2024.3.0-beta.0, current master branch
Problem description
https://console.firebase.google.com/u/1/project/api-project-322300403941/crashlytics/app/android:org.odk.collect.android/issues/7ddd17ca0a93e82d425a5a441cf649de?time=last-seven-days&types=crash&versions=v2024.3.0-beta.0%20(4913)&sessionEventKey=66A3A763019F000148A7574DA36DB8A9_1974385087817821121
Steps to reproduce the problem
All question types
form from the demo server.All question types
form and finalize it.Expected behavior
There should be no crash.
What's going on?
The problem is that
entityFormExtra
is null after trying to read it fromformDef
collect/entities/src/main/java/org/odk/collect/entities/javarosa/finalization/EntityFormFinalizationProcessor.java
Line 31 in 4741fec
Then in the line below we try to use that object and get NPE.
But how null is returned instead of the expected
entityFormExtra
?First of all, we need to keep in mind that we cache
FormDef
after opening a form for the first time. That''s what happened in the third step (see above). The cachedFormDef
contains extras as well.Ok so now let's understand how we save/read extras. We do that using HashMap where the key is the class name (the fully qualified name of the class):
So in the third step using v2024.2.1 we save
entityFormExtra
with the key:org.javarosa.entities.internal.EntityFormExtra
.However, then we decided that
EntityFormExtra
class along with its whole package should be moved from Javarosa to Collect what was implemented in #6236 and became a part of v2024.3.0-beta.0.As a result, if we now try to load such extras from cache we try to read them using
org.odk.collect.entities.javarosa.parse.EntityFormExtra
and get null because they exist but are stored with the old class name as a keyorg.javarosa.entities.internal.EntityFormExtra
.The text was updated successfully, but these errors were encountered: