Skip to content

Null check field map before using it#6680

Merged
labkey-adam merged 1 commit intodevelopfrom
fb_field_map_npe
May 20, 2025
Merged

Null check field map before using it#6680
labkey-adam merged 1 commit intodevelopfrom
fb_field_map_npe

Conversation

@labkey-adam
Copy link
Copy Markdown
Contributor

@labkey-adam labkey-adam commented May 19, 2025

Rationale

After merging the related PR, OConnorExperimentTest started failing when attempting to render a multi-valued field while rendering a bulk edit page. This seems to fix it.

https://teamcity.labkey.org/buildConfiguration/bt401/3514983

I can't explain with certainty what changed here, but here's my guess, based on what I've seen:

  • Previously (25.3) the RenderContext passed to MutiValuedRenderContext failed to resolve ParentExperiments/Container and ParentExperiments/ExperimentNumber (in MultiValueRenderContext constructor)
  • MultiValuedDisplayColumn.values() then saw only null values for these field keys, so next() returned false, bypassing calls to the passed in Function
  • Early in 25.4, a display column refactor caused us to bypass the MV getInputValue() code path entirely
  • Later, Matt made changes that populated more values into the context (??)
  • Nick & I just fixed the bypass with Fix multi-valued input form fields #6674, so MV getInputValue() code path is live again. It now resolves those field keys and invokes MultiValuedRenderContext.get(), which unconditionally uses the field map, causing an NPE in this case.

Related Pull Requests

@labkey-adam
Copy link
Copy Markdown
Contributor Author

@labkey-adam labkey-adam merged commit b094769 into develop May 20, 2025
11 checks passed
@labkey-adam labkey-adam deleted the fb_field_map_npe branch May 20, 2025 17:26
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.

2 participants