Entry can be null and remove other ! usages

This commit is contained in:
Adam Hathcock
2024-04-18 13:24:03 +01:00
parent 900190cf54
commit e96366f489
22 changed files with 61 additions and 43 deletions

View File

@@ -36,10 +36,10 @@ internal static class ExtractionMethods
options ??= new ExtractionOptions() { Overwrite = true };
var file = Path.GetFileName(entry.Key);
var file = Path.GetFileName(entry.Key.NotNull("Entry Key is null")).NotNull("File is null");
if (options.ExtractFullPath)
{
var folder = Path.GetDirectoryName(entry.Key)!;
var folder = Path.GetDirectoryName(entry.Key.NotNull("Entry Key is null")).NotNull("Directory is null");
var destdir = Path.GetFullPath(Path.Combine(fullDestinationDirectoryPath, folder));
if (!Directory.Exists(destdir))