Skip to content

Commit bca5ec4

Browse files
committed
Exit early on invalid wrappers
1 parent 303fa31 commit bca5ec4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

BinaryObjectScanner/Scanner.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,11 @@ private ProtectionDictionary GetInternalProtections(string fileName, Stream stre
304304

305305
// Get the wrapper, if possible
306306
var wrapper = WrapperFactory.CreateWrapper(fileType, stream);
307+
if (wrapper == null)
308+
{
309+
if (_includeDebug) Console.WriteLine($"{fileName} not a scannable file type, skipping...");
310+
return [];
311+
}
307312

308313
#region Non-Archive File Types
309314

0 commit comments

Comments
 (0)