diff --git a/MPF.Library/Protection.cs b/MPF.Library/Protection.cs
index 211b0235..4bcc8fe1 100644
--- a/MPF.Library/Protection.cs
+++ b/MPF.Library/Protection.cs
@@ -57,29 +57,30 @@ namespace MPF.Library
}
///
- /// Get the existance of an anti-modchip string from a PlayStation disc, if possible
+ /// Get the existence of an anti-modchip string from a PlayStation disc, if possible
///
/// Path to scan for anti-modchip strings
- /// Anti-modchip existance if possible, false on error
+ /// Anti-modchip existence if possible, false on error
public static async Task GetPlayStationAntiModchipDetected(string path)
{
return await Task.Run(() =>
{
- var antiModchip = new PSXAntiModchip();
- foreach (string file in Directory.EnumerateFiles(path, "*", SearchOption.AllDirectories))
+ try
{
- try
+ var antiModchip = new PSXAntiModchip();
+ foreach (string file in Directory.EnumerateFiles(path, "*", SearchOption.AllDirectories))
{
- byte[] fileContent = File.ReadAllBytes(file);
- string protection = antiModchip.CheckContents(file, fileContent, false, null, null);
- if (!string.IsNullOrWhiteSpace(protection))
- return true;
- }
- catch
- {
- // No-op, we don't care what the error was
+ try
+ {
+ byte[] fileContent = File.ReadAllBytes(file);
+ string protection = antiModchip.CheckContents(file, fileContent, false, null, null);
+ if (!string.IsNullOrWhiteSpace(protection))
+ return true;
+ }
+ catch { }
}
}
+ catch { }
return false;
});