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

Fix crash for non-String entity labels #770

Merged
merged 3 commits into from
Jun 17, 2024
Merged

Conversation

seadowg
Copy link
Member

@seadowg seadowg commented Jun 10, 2024

Closes getodk/collect#6167

What has been done to verify that this works as intended?

New tests!

Why is this the best possible solution? Were any other approaches considered?

Not a lot to discuss here. We now always convert to a string instead of casting, which should work for all the possible types.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

The change is pretty specific, and will only affect entity forms.

@seadowg seadowg changed the title Fix crash for non-String entity labels Fix crash for non-String entity labels Jun 10, 2024
@seadowg seadowg marked this pull request as ready for review June 10, 2024 16:25

@Test
public void parseLabel_whenLabelIsAnInt_convertsToString() {
TreeElement labelElement = new TreeElement("label");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should have consts for values like this one label and maybe for some others too like id

@seadowg seadowg requested a review from lognaturel June 17, 2024 14:08
@seadowg seadowg merged commit 3bba4dd into getodk:master Jun 17, 2024
3 checks passed
@seadowg seadowg deleted the label-type branch June 17, 2024 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when finalizing an entity form that doesn't use a string label
3 participants