{
  "WorkItem": {
    "AffectedComponent": {
      "Name": "",
      "DisplayName": ""
    },
    "ClosedComment": "No activity for 5 weeks.  Re-open if you have a test case.",
    "ClosedDate": "2009-12-18T12:31:00.58-08:00",
    "CommentCount": 0,
    "Custom": null,
    "Description": "When creating a ZipOutputStream all apparently goes well when actually writing compressed bytes to the file, but when it comes to disposing the stream the above exception is thrown.\n \nAfter testing various configurations of code and settings, the stack trace for this is shown to consistently be:\n \nError: System.NullReferenceException: Object reference not set to an instance of an object.\n   at Ionic.Zip.ZipOutput.GenCentralDirectoryFooter(Int64 StartOfCentralDirectory, Int64 EndOfCentralDirectory, Zip64Option zip64, Int32 entryCount, String comment, Encoding encoding)\n   at Ionic.Zip.ZipOutput.WriteCentralDirectoryStructure(Stream s, List`1 _entries, UInt32 numSegments, Zip64Option zip64, String comment, Encoding encoding)\n   at Ionic.Zip.ZipOutputStream.Close()\n   at System.IO.Stream.Dispose()\n   at ... /* end of ZipOutputStream's 'using' statement within main program */ ...\n \nThis seems to me to mean that anybody following the code exactly as described within the ZipOutputStream page of the help documentation will be unable to generate valid zip files.\n \nI have not delved deeply into the workings of the library, but at first glance there appears to me to be one obvious candidate line for concern within GenCentralDirectoryFooter, such as:\n \n...\n if ((comment != null) && (comment.Length != 0))\n    {\n        block = encoding.GetBytes(comment);   <<<<< encoding not checked for null value\n        commentLength = (short) block.Length;\n    }\n...\n \nI would love to see this issue resolved ASAP, as the library looks pretty useful otherwise.",
    "LastUpdatedDate": "2013-05-16T05:32:00.22-07:00",
    "PlannedForRelease": "",
    "ReleaseVisibleToPublic": false,
    "Priority": {
      "Name": "Low",
      "Severity": 50,
      "Id": 1
    },
    "ProjectName": "DotNetZip",
    "ReportedDate": "2009-11-05T01:39:58.247-08:00",
    "Status": {
      "Name": "Closed",
      "Id": 4
    },
    "ReasonClosed": {
      "Name": "Unassigned"
    },
    "Summary": "System.NullReferenceException when using ZipOutputStream",
    "Type": {
      "Name": "Issue",
      "Id": 3
    },
    "VoteCount": 1,
    "Id": 9124
  },
  "FileAttachments": [],
  "Comments": [
    {
      "Message": "I;d love to help you but.. \r\nyou didn't give me the code that is causing the problem.  I took the code from the ZipOutputStream constructor : [ ZipOutputStream(String) ], and compiled and ran it.  It worked fine.  \r\n\r\nYou can upload files to this workitem.  Why don't you put together a simple testcase - a console application that demonstrates the problem you're having. If it is reliably reproducible, it should take just a few lines to show me how you are doing it. \r\n\r\nAs for your code review - I don't see the  problem, but obviously if you have a test case that throws an exception, then it needs to be fixed.\r\n\r\n",
      "PostedDate": "2009-11-07T03:54:30.713-08:00",
      "Id": -2147483648
    },
    {
      "Message": "Any update on this? Love to get a test case that works.",
      "PostedDate": "2009-11-13T23:21:04.237-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2009-12-18T12:31:00.58-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-02-21T18:43:49.69-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-05-16T05:32:00.22-07:00",
      "Id": -2147483648
    }
  ]
}