mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
Get NullReferenceException after saving last entry of a 7zip archive #13
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @donRumatta on GitHub (Apr 29, 2014).
I'm using the example:
var archive = ArchiveFactory.Open(item.FullName);
foreach (var entry in archive.Entries)
{
if (!entry.IsDirectory)
{
entry.WriteToDirectory(@"C:\Research\SharpCompress\SharpCompress\Archives");
}
}
Decompressing is done successfully only if file has some content. If it is empty I get NullReferenceException in ListeningStream.Read (Stream is null). As I understand archiveEntry.OpenEntryStream() returns null.
Archive can be downloaded from the same issue posted on CodePlex.
And it is important, that such issue appears only with 7zip, rar and zip are processed without errors.
UPD. the main reason is that file.HasStream = !emptyStreamVector[i]; is false for my archive. How can it be changed to true?