Skip to content

Avoid NPE in compare when the actual buildinfo has no length or sha512 entry - #271

Open
SAY-5 wants to merge 1 commit into
apache:masterfrom
SAY-5:compare-null-length
Open

SAY-5 wants to merge 1 commit into
apache:masterfrom
SAY-5:compare-null-length

Conversation

@SAY-5

@SAY-5 SAY-5 commented Oct 18, 2026

Copy link
Copy Markdown

Closes #244

checkArtifact compared with actualLength.equals(referenceLength) and actualSha512.equals(referenceSha512), so a freshly generated buildinfo without a .length or .checksums.sha512 entry failed with a NullPointerException instead of reporting the artifact as mismatched. Move the three checks into a small helper that uses Objects.equals and add a unit test for the missing length case.


To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
check one of the following:

…2 entry

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
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.

compare: NPE when buildinfo length/sha512 entry is missing

1 participant