Closed edwardmjackson closed 7 months ago
As a follow up, this is probably a sketchy file header in the gzip file, looking at https://github.com/adamhathcock/sharpcompress/blob/900190cf54423ebc1187b647094b118881ab9485/src/SharpCompress/Common/GZip/GZipFilePart.cs#L94
Trivial workaround for now:
using IReader reader = ReaderFactory.Open(sourceStream);
while (reader.MoveToNextEntry())
{
if (!reader.Entry.IsDirectory)
{
reader.WriteEntryToFile(decompressedFileLocation, new ExtractionOptions { ExtractFullPath = false, Overwrite = true });
}
}
you're saying the entry.Key can be null?
Correct. The ! on this line
is masking it, but it can be null (in possibly wierdly-formed files that open fine in 7Zip)
0.37.0 has fixed null support so maybe this isn't an issue now?
The generic extraction mechanism implemented in ExtractionMethods.cs appears to fail for GZip files.
Path.Combine throws an exception at https://github.com/adamhathcock/sharpcompress/blob/900190cf54423ebc1187b647094b118881ab9485/src/SharpCompress/Common/ExtractionMethods.cs#L60
due to fileName being null, which is set here
https://github.com/adamhathcock/sharpcompress/blob/900190cf54423ebc1187b647094b118881ab9485/src/SharpCompress/Common/ExtractionMethods.cs#L39