tomap / SevenZipSharp

Fork of SevenZipSharp on CodePlex
Other
65 stars 166 forks source link

CommonDispose in SevenZipExtractor #3

Open hoi82 opened 8 years ago

hoi82 commented 8 years ago

Line 763, 764 is,

_inStream.Dispose(); _inStream = null;

When I use this class, _inStream is set null, so the error is occured at above lines, Why don't you check _instream is null?

DomZZZ commented 8 years ago

I reproduced the exact same issue 👍 Here is my code

                Configuration conf = null;
                using (var extractor = new SevenZip.SevenZipExtractor(uploadedFile))
                {
                    var generalCfgFile = extractor.ArchiveFileNames.FirstOrDefault(f => f.IndexOf(BaseDomainService.GeneralCfgFileName) > -1);
                    using (var ms = new MemoryStream())
                    {
                        extractor.ExtractFile(generalCfgFile, ms);
                        conf = ReadHeaderFromBytes(ms.ToArray());
                    }
                }
santoshthube commented 7 years ago

I am also facing the same issue. Can anyone tell how to proceed?