Update NugetInspectorManager.java
Adding exception for nuget not being available when it applies.
@@ -83,6 +83,10 @@ public class NugetInspectorManager {
final String nugetExecutable = executableManager
.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 even though nuget applied.", ExitCodeType.FAILURE_CONFIGURATION);
+ } else {
resolvedInspectorVersion = resolveInspectorVersion(nugetExecutable);
if (resolvedInspectorVersion != null) {
resolvedNugetInspectorExecutable = installInspector(nugetExecutable, detectFileManager.getSharedDirectory("nuget"), resolvedInspectorVersion);
@@ -93,6 +97,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);
