Skip to content
Permalink
Browse files
Fix JENKINS-12047
Added try/catch around environment gathering.
  • Loading branch information
slide committed Mar 24, 2012
1 parent 629943c commit 5f1e0c88c4be3d4a8e1e88024cd6d464a525886c
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java
@@ -315,8 +315,14 @@ private MimeMessage createMail(EmailType type, AbstractBuild<?, ?> build, BuildL
AttachmentUtils attachments = new AttachmentUtils(attachmentsPattern);
attachments.attach(multipart, build, listener);
msg.setContent(multipart);

EnvVars env = build.getEnvironment(listener);
EnvVars env = null;
try {
env = build.getEnvironment(listener);
} catch(Exception e) {
listener.getLogger().println("Error retrieving environment vars: " + e.getMessage());
// create an empty set of env vars
env = new EnvVars();
}

// Get the recipients from the global list of addresses
Set<InternetAddress> recipientAddresses = new LinkedHashSet<InternetAddress>();

0 comments on commit 5f1e0c8

Please sign in to comment.