Skip to content

Clarify NPE when resolveScm omits targets - #577

Merged
jglick merged 2 commits into
jenkinsci:masterfrom
Chikzz2001:fix-resolveScm-null-targets
Jul 24, 2026
Merged

Clarify NPE when resolveScm omits targets#577
jglick merged 2 commits into
jenkinsci:masterfrom
Chikzz2001:fix-resolveScm-null-targets

Conversation

@Chikzz2001

Copy link
Copy Markdown
Contributor

When targets is omitted from resolveScm, Pipeline DataBoundConstructor binding passes null and new ArrayList<>(null) throws a cryptic NPE (JENKINS-67005 / jenkinsci/github-branch-source-plugin#1380).

Fail fast with a clear message that targets is required.

Testing done

  • Added unit test covering null targets
  • Existing ResolveScmStepTest scenarios unchanged

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

Made with Cursor

@Chikzz2001
Chikzz2001 requested a review from a team as a code owner July 24, 2026 13:04
@Chikzz2001
Chikzz2001 force-pushed the fix-resolveScm-null-targets branch from 4f3bd58 to f4bd9fe Compare July 24, 2026 13:04
@Chikzz2001
Chikzz2001 force-pushed the fix-resolveScm-null-targets branch from e1a3ae6 to 6e35cff Compare July 24, 2026 17:39
@Chikzz2001
Chikzz2001 requested a review from jglick July 24, 2026 17:41
@jglick
jglick merged commit ec5b9e1 into jenkinsci:master Jul 24, 2026
17 checks passed
@Chikzz2001
Chikzz2001 deleted the fix-resolveScm-null-targets branch July 25, 2026 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants