Skip to content

Guard against NPE in BagGenerator#12246

Open
janvanmansum wants to merge 1 commit intoIQSS:developfrom
janvanmansum:DD-2164
Open

Guard against NPE in BagGenerator#12246
janvanmansum wants to merge 1 commit intoIQSS:developfrom
janvanmansum:DD-2164

Conversation

@janvanmansum
Copy link
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?:
No

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for Triage

Development

Successfully merging this pull request may close these issues.

2 participants