Fix new (nullability) compiler warnings

This commit is contained in:
Tamas Vajk
2021-02-10 10:40:57 +01:00
parent 71f095d6d4
commit 4f383be13b
9 changed files with 74 additions and 22 deletions

View File

@@ -247,7 +247,13 @@ namespace Semmle.Extraction
}
try
{
Directory.CreateDirectory(Path.GetDirectoryName(nested));
var directoryName = Path.GetDirectoryName(nested);
if (directoryName is null)
{
logger.Log(Severity.Warning, "Failed to get directory name from path '" + nested + "'.");
throw new InvalidOperationException();
}
Directory.CreateDirectory(directoryName);
}
catch (PathTooLongException)
{