diff --git a/core/src/main/java/hudson/cli/InstallPluginCommand.java b/core/src/main/java/hudson/cli/InstallPluginCommand.java index 10fdb153e0..0e6f384373 100644 --- a/core/src/main/java/hudson/cli/InstallPluginCommand.java +++ b/core/src/main/java/hudson/cli/InstallPluginCommand.java @@ -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))); } diff --git a/core/src/main/java/hudson/model/AbstractBuild.java b/core/src/main/java/hudson/model/AbstractBuild.java index 78d84ca4a6..cdc6adc2f7 100644 --- a/core/src/main/java/hudson/model/AbstractBuild.java +++ b/core/src/main/java/hudson/model/AbstractBuild.java @@ -425,14 +425,16 @@ public abstract class AbstractBuild

,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 log = c.getLogText(); - StringWriter w = new StringWriter(); - log.writeHtmlTo(Math.max(0,c.getLogFile().length()-10240),w); + 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 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(); + listener.getLogger().print(ExpandableDetailsNote.encodeTo("details",w.toString())); + listener.getLogger().println(); + } } // kill run-away processes that are left