mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C#: Make sure that the file exists before attempting to get version info.
This commit is contained in:
@@ -76,7 +76,7 @@ namespace Semmle.Extraction.CSharp
|
||||
|
||||
// If csc is specified as compiler name, then attempt to read the version information from csc.dll
|
||||
var compilerBinaryName = Path.GetFileName(SpecifiedCompiler) == "csc" ? $"{SpecifiedCompiler}.dll" : SpecifiedCompiler;
|
||||
var versionInfo = FileVersionInfo.GetVersionInfo(compilerBinaryName);
|
||||
var versionInfo = FileVersionInfo.GetVersionInfo(File.Exists(compilerBinaryName) ? compilerBinaryName : SpecifiedCompiler);
|
||||
if (!knownCompilerNames.TryGetValue(versionInfo.OriginalFilename ?? string.Empty, out var vendor))
|
||||
{
|
||||
SkipExtractionBecause("the compiler name is not recognised");
|
||||
|
||||
Reference in New Issue
Block a user