Skip to content

Conversation

@shubh586
Copy link

@shubh586 shubh586 commented Jan 5, 2026

Description

Fixes JENKINS-68961 by failing gracefully when an empty or whitespace-only email
address is provided. Previously, blank values were passed to JavaMail, resulting
in an AddressException stack trace. This change adds explicit validation to
reject blank input early with a clear, user-friendly error message.

Testing done

  • Added a JUnit test (emptyAddressShouldFailGracefully) that verifies
    Mailer.stringToAddress fails gracefully when an empty email address is provided.
  • Verified locally that the test fails without the fix and passes with the fix:
    mvn -Dtest=MailerTest#emptyAddressShouldFailGracefully test

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 (JENKINS-68961)
  • Link to relevant pull requests, esp. upstream and downstream changes (not applicable)
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

@shubh586 shubh586 requested a review from a team as a code owner January 5, 2026 21:20
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