From 166d69c7ec5a6b4588f5ee2ce2f59e99690f1bdf Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sun, 3 Oct 2021 13:53:23 -0700 Subject: [PATCH] Fix NRE in InfoTool --- MPF.Library/InfoTool.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/MPF.Library/InfoTool.cs b/MPF.Library/InfoTool.cs index 435a83b0..017edfa7 100644 --- a/MPF.Library/InfoTool.cs +++ b/MPF.Library/InfoTool.cs @@ -414,9 +414,12 @@ namespace MPF.Library break; case RedumpSystem.SonyPlayStation: - resultProgress?.Report(Result.Success("Checking for anti-modchip strings... this might take a while!")); - info.CopyProtection.AntiModchip = await GetAntiModchipDetected(drive) ? YesNo.Yes : YesNo.No; - resultProgress?.Report(Result.Success("Anti-modchip string scan complete!")); + if (drive != null) + { + resultProgress?.Report(Result.Success("Checking for anti-modchip strings... this might take a while!")); + info.CopyProtection.AntiModchip = await GetAntiModchipDetected(drive) ? YesNo.Yes : YesNo.No; + resultProgress?.Report(Result.Success("Anti-modchip string scan complete!")); + } // Special case for DIC only if (parameters.InternalProgram == InternalProgram.DiscImageCreator) @@ -493,7 +496,7 @@ namespace MPF.Library /// Copy protection scheme if possible, null on error private static async Task GetCopyProtection(Drive drive, Options options, IProgress progress = null) { - if (options.ScanForProtection) + if (options.ScanForProtection && drive != null) { (bool success, string output) = await Protection.RunProtectionScanOnPath($"{drive.Letter}:\\", options, progress); if (success)