mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 05:25:00 +00:00
Null reference when disposing a Volume class #138
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 @JasonBro on GitHub (Oct 3, 2016).
There's a new bit of code in the SharpCompress.Common.Volume class that causes a null exception when ReaderOptions is null (which it is by default).
Workround: Add a ReaderOptions in the Open(Stream, ReaderOptions) call.
@adamhathcock commented on GitHub (Oct 3, 2016):
Oh no. Thanks for reporting this. I'll fix it.
@JasonBro commented on GitHub (Oct 3, 2016):
I know that feeling! I would have fixed it myself with a pull request, but
there might be other places that were changed as well.
I'm in no rush for the fix and it only took 2 minutes to find a work round.
Thanks for creating a great library.
Cheers
Jason
On 3 October 2016 at 13:22, Adam Hathcock notifications@github.com wrote:
@adamhathcock commented on GitHub (Oct 3, 2016):
What archive format are you using? I was hoping that the options would never be null by the time it got to the
Volumeclass.@JasonBro commented on GitHub (Oct 3, 2016):
This is the bit of code:-
using (var stream = await file.OpenAsync(FileAccess.Read))
{
using (var archive = SevenZipArchive.Open(stream))
{
...
On 3 October 2016 at 13:27, Adam Hathcock notifications@github.com wrote:
@adamhathcock commented on GitHub (Oct 3, 2016):
Thanks, found it. Also found another null issue while reviewing the code paths.
I wish I could mock test this stuff but not possible with this code :(
@JasonBro commented on GitHub (Oct 3, 2016):
Besides, no matter how much you test it, someone will come up with ways of
using it you'd not thought of!
On 3 October 2016 at 13:34, Adam Hathcock notifications@github.com wrote:
@adamhathcock commented on GitHub (Oct 3, 2016):
https://www.nuget.org/packages/sharpcompress/0.13.1
@JasonBro commented on GitHub (Oct 3, 2016):
Perfect! Thanks for your fast response. :-)
On 3 October 2016 at 13:51, Adam Hathcock notifications@github.com wrote: