diff --git a/MicroWin/functions/iso/IsoManager.cs b/MicroWin/functions/iso/IsoManager.cs index 731462d..0ac4c9c 100755 --- a/MicroWin/functions/iso/IsoManager.cs +++ b/MicroWin/functions/iso/IsoManager.cs @@ -52,7 +52,7 @@ private string BuildIsoObjectPath(string isoPath) return String.Format("MSFT_DiskImage.ImagePath={0},StorageType=1", $"\"{isoPath.Replace("\\", "\\\\")}\""); } - public void ExtractIso(string? driveLetter, string destination, Action progressCallback, Action fileProgressCallback) + public void ExtractIso(string? driveLetter, string destination, Action? progressCallback = null, Action? fileProgressCallback = null) { string source = $"{driveLetter}:\\"; DynaLog.logMessage($"Starting extraction from {source} to {destination}"); @@ -124,13 +124,13 @@ public void ExtractIso(string? driveLetter, string destination, Action prog string? destDir = Path.GetDirectoryName(destFile); if (!Directory.Exists(destDir)) Directory.CreateDirectory(destDir ?? ""); - fileProgressCallback.Invoke(file); + if (fileProgressCallback is not null) fileProgressCallback.Invoke(file); File.Copy(file, destFile, true); copiedFiles++; int percentage = (int)((double)copiedFiles / files.Length * 100); - progressCallback?.Invoke(percentage); + if (progressCallback is not null) progressCallback.Invoke(percentage); } catch (Exception ex) {