Skip to content

Commit

Permalink
[CompressionLibrary] - Fixes SharpZipLib bug: icsharpcode/SharpZipLib…
Browse files Browse the repository at this point in the history
…#879

[CompressionLibrary] - Fixes SharpZipLib bug: icsharpcode/SharpZipLib#879
  • Loading branch information
GitHubProUser67 committed Oct 19, 2024
1 parent d88197d commit 95f20cc
Showing 1 changed file with 26 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<ZipEntry>();
isNewArchive_ = true;
}
}

Expand Down Expand Up @@ -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<ZipEntry>();
isNewArchive_ = true;
}
}

Expand Down

0 comments on commit 95f20cc

Please sign in to comment.