mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-09 02:16:46 +00:00
More graceful handling of MS-CAB sets
This commit is contained in:
@@ -33,8 +33,14 @@ namespace BinaryObjectScanner.FileType
|
||||
#if NET20 || NET35 || !WINX86
|
||||
// TODO: Remove once Serialization is updated
|
||||
|
||||
// Get a wrapper for the set
|
||||
var current = OpenSet(file);
|
||||
// Get a wrapper for the set, if possible
|
||||
SabreTools.Serialization.Wrappers.MicrosoftCabinet? current;
|
||||
if (File.Exists(file))
|
||||
current = OpenSet(file);
|
||||
else
|
||||
current = SabreTools.Serialization.Wrappers.MicrosoftCabinet.Create(stream);
|
||||
|
||||
// Validate the header exists
|
||||
if (current?.Model?.Header == null)
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user