{
  "WorkItem": {
    "AffectedComponent": {
      "Name": "",
      "DisplayName": ""
    },
    "ClosedComment": "",
    "ClosedDate": null,
    "CommentCount": 0,
    "Custom": null,
    "Description": "Hi,\n\nI use __AddEntry(entryName,  opener, closer)__ method and used to work properly until I tried to add another zip.\n\nIn this case NullReferenceException is thrown. In debug I found out that __closer__ delegate is called twice and __stream__ parameter is null in the second call. \n\nVersion of __Ionic.Zipdll__: 1.9.1.8\n\nDuring further investigation I noticed that this issue is not replicated with smaller ZIP archive. I attached test one.\n\nHere is a simple code snippet to replicate the issue.\n```\nusing (Ionic.Zip.ZipFile zip = new Ionic.Zip.ZipFile(\"some name.zip\"))\n{\n    Dictionary<string, string> entries = new Dictionary<string, string>();\n    entries.Add(\"file name to use.zip\", @\"1.zip\");\n    foreach (var key in entries.Keys)\n        zip.AddEntry(key,\n                    new Ionic.Zip.OpenDelegate(name =>\n                    {\n                        return File.OpenRead(entries[name]);\n                    }),\n                    new Ionic.Zip.CloseDelegate((name, stream) =>\n                    {\n                        stream.Close();\n                    }));\n    zip.Save();\n}\n```",
    "LastUpdatedDate": "2014-04-17T03:38:05.39-07:00",
    "PlannedForRelease": "",
    "ReleaseVisibleToPublic": false,
    "Priority": {
      "Name": "Unassigned",
      "Severity": 0,
      "Id": 0
    },
    "ProjectName": "DotNetZip",
    "ReportedDate": "2014-04-17T02:30:59.207-07:00",
    "Status": {
      "Name": "Proposed",
      "Id": 1
    },
    "ReasonClosed": {
      "Name": "Unassigned"
    },
    "Summary": "Error using AddEntry(entryName,  opener, closer) if new entry is archive",
    "Type": {
      "Name": "Unassigned",
      "Id": 5
    },
    "VoteCount": 1,
    "Id": 16813
  },
  "FileAttachments": [
    {
      "FileId": 4875,
      "FileName": "1.zip",
      "DownloadUrl": ".\\4875"
    }
  ],
  "Comments": [
    {
      "Message": "I looked through sources and here is what I noticed:\n1. It is file specific issue: __1.zip__ contains other compressed ZIP.\n2. __closer__ delegate is called twice because __WantReadAgain()__ method  returns __true__ for this specific archive (1.zip):  __CompressedSize_ equals to __UncompressedSize_.\r\n\r\nI do not want to fix it by changing IF statement condition in the __WantReadAgain()__ method to:\n```\n_CompressedSize <= _UncompressedSize\n```\nbecause I do not know potential risks.\r\n\r\nPlease assist with this issue.",
      "PostedDate": "2014-04-17T03:38:05.39-07:00",
      "Id": -2147483648
    }
  ]
}