Fixing a nuget issue where no executable threw an NPE.
@@ -81,7 +81,11 @@ public class NugetInspectorManager {
public void install() throws DetectUserFriendlyException, ExecutableRunnerException, IOException {
final String nugetExecutable = executableManager
- .getExecutablePathOrOverride(ExecutableType.NUGET, true, new File(detectConfiguration.getProperty(DetectProperty.DETECT_SOURCE_PATH)), detectConfiguration.getProperty(DetectProperty.DETECT_NUGET_PATH));
+ .getExecutablePathOrOverride(ExecutableType.NUGET, true, new File(detectConfiguration.getProperty(DetectProperty.DETECT_SOURCE_PATH)),
+ detectConfiguration.getProperty(DetectProperty.DETECT_NUGET_PATH));
+ if (nugetExecutable == null) {
+ throw new DetectUserFriendlyException("Unable to find a nuget executable.", ExitCodeType.FAILURE_CONFIGURATION);
+ } else {
resolvedInspectorVersion = resolveInspectorVersion(nugetExecutable);
if (resolvedInspectorVersion != null) {
resolvedNugetInspectorExecutable = installInspector(nugetExecutable, detectFileManager.getSharedDirectory("nuget"), resolvedInspectorVersion);
@@ -92,6 +96,7 @@ public class NugetInspectorManager {
throw new DetectUserFriendlyException("Unable to resolve nuget inspector version from available nuget sources.", ExitCodeType.FAILURE_CONFIGURATION);
}
}
+ }
private String resolveInspectorVersion(final String nugetExecutablePath) throws ExecutableRunnerException {
final String nugetInspectorPackageVersion = detectConfiguration.getProperty(DetectProperty.DETECT_NUGET_INSPECTOR_VERSION);
