This project has moved and is read-only. For the latest updates, please go here.
1
Vote

null reference on ZipStorer.Close()

description

If you call the Close() method within a using clause you get a null reference.
 
Sample code:
 
using (ZipStorer zipFile = ZipStorer.Create(name, ""))
{
zipFile.AddStream(ZipStorer.Compression.Deflate, "test.txt", instream, DateTime.Now, "");
zipFile.Close();
}
 
Fix:
in the Close() method first check if stream is null:
 
if (this.ZipFileStream == null)
return;

comments

jaime_olivares wrote Nov 3, 2011 at 6:52 PM

Ok, will fix it in next releaes, thanks!
Jaime.

wrote Feb 14, 2013 at 8:39 PM