diff --git a/BackendServices/CompressionLibrary/ICSharpCode.SharpZipLib/Zip/ZipFile.cs b/BackendServices/CompressionLibrary/ICSharpCode.SharpZipLib/Zip/ZipFile.cs index d52f1877..761d6742 100644 --- a/BackendServices/CompressionLibrary/ICSharpCode.SharpZipLib/Zip/ZipFile.cs +++ b/BackendServices/CompressionLibrary/ICSharpCode.SharpZipLib/Zip/ZipFile.cs @@ -428,14 +428,22 @@ public ZipFile(string name, StringCodec stringCodec) _stringCodec = stringCodec; } - try + if (baseStream_.Length > 0) { - ReadEntries(); + try + { + ReadEntries(); + } + catch + { + DisposeInternal(true); + throw; + } } - catch + else { - DisposeInternal(true); - throw; + entries_ = Empty.Array(); + isNewArchive_ = true; } } @@ -484,14 +492,22 @@ public ZipFile(FileStream file, bool leaveOpen) name_ = file.Name; isStreamOwner = !leaveOpen; - try + if (baseStream_.Length > 0) { - ReadEntries(); + try + { + ReadEntries(); + } + catch + { + DisposeInternal(true); + throw; + } } - catch + else { - DisposeInternal(true); - throw; + entries_ = Empty.Array(); + isNewArchive_ = true; } }