From a7364eab6793e7abce33221e6d688f0ea47cd83a Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 30 Oct 2020 21:43:40 -0700 Subject: [PATCH] Comments and a better guard --- BurnOutSharp/ProtectionFind.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/BurnOutSharp/ProtectionFind.cs b/BurnOutSharp/ProtectionFind.cs index fd683979..ae4ddeb7 100644 --- a/BurnOutSharp/ProtectionFind.cs +++ b/BurnOutSharp/ProtectionFind.cs @@ -144,8 +144,8 @@ namespace BurnOutSharp /// /// Scan a path for indications of copy protection /// - /// - /// + /// Path to scan file and folder names + /// True if the path is a directory, false otherwise /// public static string ScanPath(string path, bool isDirectory) { @@ -383,9 +383,16 @@ namespace BurnOutSharp /// True to include scanned copy protection position, false otherwise (default) public static string ScanContent(string file, bool includePosition = false) { - using (FileStream fs = File.OpenRead(file)) + try { - return ScanContent(fs, file, includePosition); + using (FileStream fs = File.OpenRead(file)) + { + return ScanContent(fs, file, includePosition); + } + } + catch + { + return null; } }