Skip to content

fix: handle skipped artifacts in calculateArtifactHash to prevent NPE#1547

Open
tharakadesilva wants to merge 1 commit into
bazel-contrib:masterfrom
tharakadesilva:fix/calculate-artifact-hash-npe-skipped-artifacts
Open

fix: handle skipped artifacts in calculateArtifactHash to prevent NPE#1547
tharakadesilva wants to merge 1 commit into
bazel-contrib:masterfrom
tharakadesilva:fix/calculate-artifact-hash-npe-skipped-artifacts

Conversation

@tharakadesilva

Copy link
Copy Markdown
Contributor

Skipped artifacts (missing sha256/path) appear in the lock file's repositories and dependencies maps but have no shasums entry, so calculateArtifactHash never creates an allInfos entry for them. Looking up these keys in allInfos returned null, causing a NullPointerException.

Guard the repository and dependency lookups in calculateArtifactHash with null checks to gracefully skip artifacts not present in allInfos.

Skipped artifacts (missing sha256/path) appear in the lock file's
repositories and dependencies maps but have no shasums entry, so
calculateArtifactHash never creates an allInfos entry for them.
Looking up these keys in allInfos returned null, causing a
NullPointerException.

Guard the repository and dependency lookups in calculateArtifactHash
with null checks to gracefully skip artifacts not present in allInfos.
@tharakadesilva
tharakadesilva force-pushed the fix/calculate-artifact-hash-npe-skipped-artifacts branch 2 times, most recently from e2b1994 to dbfc1ad Compare March 3, 2026 14:48
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.

1 participant