Skip to content

Guard against NPE in BagGenerator#12246

Merged
stevenwinship merged 2 commits intoIQSS:developfrom
janvanmansum:DD-2164
Mar 27, 2026
Merged

Guard against NPE in BagGenerator#12246
stevenwinship merged 2 commits intoIQSS:developfrom
janvanmansum:DD-2164

Conversation

@janvanmansum
Copy link
Copy Markdown
Contributor

@janvanmansum janvanmansum commented Mar 23, 2026

What this PR does / why we need it
When there are more than one contacts, it may occur that one of them does not have a "name" sub-field. In that case contactNameTerm is not null, but ((JsonObject) person).get(contactNameTerm.getLabel()) does evaluate to null, causing an NPE.

Which issue(s) this PR closes:
N/a

Special notes for your reviewer:
None

Suggestions on how to test this:

  1. Create a dataset with two contacts:
  • One with all subfields filled out.
  • One without a "name"
  1. Archive the dataset

Before fix, the archiving will fail.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:
No

Is there a release notes update needed for this change?:
See: https://github.com/IQSS/dataverse/pull/12246/changes#diff-3dd3cb83d7219250c6bfbacb2f7d829b806a67e46020967f63ab039b5e506d3f

Additional documentation:
N/a

@pdurbin pdurbin moved this to Ready for Triage in IQSS Dataverse Project Mar 23, 2026
@pdurbin pdurbin changed the title Guard against NPE Guard against NPE in BagGenerator Mar 23, 2026
@scolapasta scolapasta moved this from Ready for Triage to Ready for Review ⏩ in IQSS Dataverse Project Mar 24, 2026
Copy link
Copy Markdown
Member

@qqmyers qqmyers left a comment

Choose a reason for hiding this comment

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

Looks good. It's a small change but could have a release note.

@github-project-automation github-project-automation bot moved this from Ready for Review ⏩ to Ready for QA ⏩ in IQSS Dataverse Project Mar 25, 2026
@stevenwinship stevenwinship moved this from Ready for QA ⏩ to QA ✅ in IQSS Dataverse Project Mar 26, 2026
@stevenwinship stevenwinship self-assigned this Mar 26, 2026
@janvanmansum
Copy link
Copy Markdown
Contributor Author

Looks good. It's a small change but could have a release note.

Added one: https://github.com/IQSS/dataverse/pull/12246/changes#diff-3dd3cb83d7219250c6bfbacb2f7d829b806a67e46020967f63ab039b5e506d3f

@stevenwinship
Copy link
Copy Markdown
Contributor

Reproduced bug in develop branch. Verified new fix works. Will merge once the develop branch code freeze ends.

@cmbz cmbz added the FY26 Sprint 20 FY26 Sprint 20 (2026-03-26 - 2026-04-08) label Mar 27, 2026
@stevenwinship stevenwinship merged commit da0ed77 into IQSS:develop Mar 27, 2026
13 of 14 checks passed
@github-project-automation github-project-automation bot moved this from QA ✅ to Merged 🚀 in IQSS Dataverse Project Mar 27, 2026
@stevenwinship stevenwinship removed their assignment Mar 27, 2026
@pdurbin pdurbin added this to the 6.11 milestone Mar 27, 2026
jp-tosca pushed a commit that referenced this pull request Mar 30, 2026
* Guard against NPE

* Release note
@scolapasta scolapasta moved this from Merged 🚀 to Done 🧹 in IQSS Dataverse Project Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 20 FY26 Sprint 20 (2026-03-26 - 2026-04-08)

Projects

Status: Done 🧹

Development

Successfully merging this pull request may close these issues.

6 participants