jenkinsci/email-ext-plugin — pull request #38 by hajush (2012-04-06 23:31:44+00:00)
Title: Fix JENKINS-13317 - prevent null String derefences from the default Subject, Body, Recipient lists.

Fixed JENKINS-13317 - a call to Matcher.quoteReplacement was failing due to a null String parameter which is Matcher does not handle gracefully, causing an null pointer exception. Added a test to simulate passing in null values. The defaultBody and defaultSubject variables can potentially be null because they are set with a nullify method - which if the entries are empty, they are set to null. So we have to check for defaultBody and defaultSubject. The other three variables don't look like they can be null (JSONObject.getString only returns a non-null String or raises an exception) but it seemed safer just to check them all.

I added a unit test for this as well, and removed the unused de-reference of the publisher.recipientList local variable at the top of ContentBuilder.transformText.