Skip to content

Commit

Permalink
Fix JENKINS-12047
Browse files Browse the repository at this point in the history
Added try/catch around environment gathering.
  • Loading branch information
slide committed Mar 24, 2012
1 parent 629943c commit 5f1e0c8
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -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>();
Expand Down

0 comments on commit 5f1e0c8

Please sign in to comment.