Skip to content

Prevent NPE in BuildClasspathMojo.appendArtifactPath() when an artifact has no resolved file#1623

Merged
elharo merged 1 commit into
masterfrom
1620
May 17, 2026
Merged

Prevent NPE in BuildClasspathMojo.appendArtifactPath() when an artifact has no resolved file#1623
elharo merged 1 commit into
masterfrom
1620

Conversation

@elharo
Copy link
Copy Markdown
Contributor

@elharo elharo commented May 17, 2026

fixes #1620

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a null check for Artifact.getFile() in BuildClasspathMojo.appendArtifactPath() to prevent a potential NullPointerException when an artifact has no resolved file (e.g., system-scope or unresolved dependencies). Also renames the parameter art to artifact for clarity.

Changes:

  • Add early-return null check on artifact.getFile() with a warning log instead of dereferencing.
  • Rename parameter artartifact and remove the now-redundant @param Javadoc tags.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@elharo elharo changed the title Prevent NPE Precent in NPE in BuildClasspathMojo.appendArtifactPath() when an artifact has no resolved file May 17, 2026
@elharo elharo changed the title Precent in NPE in BuildClasspathMojo.appendArtifactPath() when an artifact has no resolved file Prevent in NPE in BuildClasspathMojo.appendArtifactPath() when an artifact has no resolved file May 17, 2026
@elharo elharo changed the title Prevent in NPE in BuildClasspathMojo.appendArtifactPath() when an artifact has no resolved file Prevent NPE in BuildClasspathMojo.appendArtifactPath() when an artifact has no resolved file May 17, 2026
@elharo elharo merged commit a22006d into master May 17, 2026
23 checks passed
@elharo elharo deleted the 1620 branch May 17, 2026 21:39
@github-actions github-actions Bot added this to the 3.11.0 milestone May 17, 2026
@github-actions
Copy link
Copy Markdown

@elharo Please assign appropriate label to PR according to the type of change.

@elharo elharo added the bug Something isn't working label May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Potential NPE in BuildClasspathMojo.appendArtifactPath() when artifact file is null

3 participants