From 61d186cae3a7b255170577896357f56b61ac79f8 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sat, 20 Sep 2025 15:58:52 -0400 Subject: [PATCH] Slight tweak to logic direction and formatting --- BinaryObjectScanner/Scanner.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/BinaryObjectScanner/Scanner.cs b/BinaryObjectScanner/Scanner.cs index 083cc889..cf85a09c 100644 --- a/BinaryObjectScanner/Scanner.cs +++ b/BinaryObjectScanner/Scanner.cs @@ -302,11 +302,9 @@ namespace BinaryObjectScanner #region Non-Archive File Types - // Create a detectable for the given file type + // Try to scan file contents var detectable = CreateDetectable(fileType, wrapper); - - // If we're scanning file contents - if (detectable != null && _scanContents) + if (_scanContents && detectable != null) { var subProtection = detectable.Detect(stream, fileName, _includeDebug); protections.Append(fileName, subProtection); @@ -317,7 +315,7 @@ namespace BinaryObjectScanner #region Archive File Types // If we're scanning archives - if (wrapper is IExtractable extractable && _scanArchives) + if (_scanArchives && wrapper is IExtractable extractable) { // If the extractable file itself fails try