提交 bf7cbca2 编写于 作者: D Dave Brosius

guard against npes

上级 2cfd9393
......@@ -116,7 +116,8 @@ public class InstallPluginCommand extends CLICommand {
Data dt = s.getData();
if (dt==null)
stdout.println(Messages.InstallPluginCommand_NoUpdateDataRetrieved(s.getUrl()));
candidates.addAll(dt.plugins.keySet());
else
candidates.addAll(dt.plugins.keySet());
}
stdout.println(Messages.InstallPluginCommand_DidYouMean(source,EditDistance.findNearest(source,candidates)));
}
......
......@@ -425,14 +425,16 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
// error message doesn't point users to the slave. So let's do it here.
listener.hyperlink("/computer/"+builtOn+"/log","Looks like the node went offline during the build. Check the slave log for the details.");
// grab the end of the log file. This might not work very well if the slave already
// starts reconnecting. Fixing this requires a ring buffer in slave logs.
AnnotatedLargeText<Computer> log = c.getLogText();
StringWriter w = new StringWriter();
log.writeHtmlTo(Math.max(0,c.getLogFile().length()-10240),w);
listener.getLogger().print(ExpandableDetailsNote.encodeTo("details",w.toString()));
listener.getLogger().println();
if (c != null) {
// grab the end of the log file. This might not work very well if the slave already
// starts reconnecting. Fixing this requires a ring buffer in slave logs.
AnnotatedLargeText<Computer> log = c.getLogText();
StringWriter w = new StringWriter();
log.writeHtmlTo(Math.max(0,c.getLogFile().length()-10240),w);
listener.getLogger().print(ExpandableDetailsNote.encodeTo("details",w.toString()));
listener.getLogger().println();
}
}
// kill run-away processes that are left
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册