{"action":"created","issue":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-net/issues/666","repository_url":"https://api.github.com/repos/couchbase/couchbase-lite-net","labels_url":"https://api.github.com/repos/couchbase/couchbase-lite-net/issues/666/labels{/name}","comments_url":"https://api.github.com/repos/couchbase/couchbase-lite-net/issues/666/comments","events_url":"https://api.github.com/repos/couchbase/couchbase-lite-net/issues/666/events","html_url":"https://github.com/couchbase/couchbase-lite-net/issues/666","id":160565862,"number":666,"title":"Unsaved attachment ContentType property throws NullReferenceException","user":{"login":"jefflill","id":4908431,"avatar_url":"https://avatars.githubusercontent.com/u/4908431?v=3","gravatar_id":"","url":"https://api.github.com/users/jefflill","html_url":"https://github.com/jefflill","followers_url":"https://api.github.com/users/jefflill/followers","following_url":"https://api.github.com/users/jefflill/following{/other_user}","gists_url":"https://api.github.com/users/jefflill/gists{/gist_id}","starred_url":"https://api.github.com/users/jefflill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jefflill/subscriptions","organizations_url":"https://api.github.com/users/jefflill/orgs","repos_url":"https://api.github.com/users/jefflill/repos","events_url":"https://api.github.com/users/jefflill/events{/privacy}","received_events_url":"https://api.github.com/users/jefflill/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-16T02:42:26Z","updated_at":"2016-06-16T02:44:30Z","closed_at":null,"body":"Couchbase.Lite v1.2.1.1\r\n\r\nI create an unsaved document revision and add an attachment.  Then before saving the revision, I get the attachment and try to access the `ContentType `property.  The property throws a `NullReferenceException`.\r\n\r\nHere's my test code:\r\n\r\n```\r\n[Fact]\r\npublic void Report_UnsavedAttachmentContentType()\r\n{\r\n    using (var db = Manager.SharedInstance.GetDatabase(\"wonky\"))\r\n    {\r\n        var doc = db.CreateDocument();\r\n        var unsaved = doc.CreateRevision();\r\n\r\n        unsaved.SetAttachment(\"attach\", \"type\", new byte[] { 0, 1, 2, 3, 4 });\r\n\r\n        var attachment = unsaved.GetAttachment(\"attach\");\r\n\r\n        Assert.Equal(\"type\", attachment.ContentType);  // <<--- Throws a NullReferenceException\r\n    }\r\n}\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-net/issues/comments/226374531","html_url":"https://github.com/couchbase/couchbase-lite-net/issues/666#issuecomment-226374531","issue_url":"https://api.github.com/repos/couchbase/couchbase-lite-net/issues/666","id":226374531,"user":{"login":"jefflill","id":4908431,"avatar_url":"https://avatars.githubusercontent.com/u/4908431?v=3","gravatar_id":"","url":"https://api.github.com/users/jefflill","html_url":"https://github.com/jefflill","followers_url":"https://api.github.com/users/jefflill/followers","following_url":"https://api.github.com/users/jefflill/following{/other_user}","gists_url":"https://api.github.com/users/jefflill/gists{/gist_id}","starred_url":"https://api.github.com/users/jefflill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jefflill/subscriptions","organizations_url":"https://api.github.com/users/jefflill/orgs","repos_url":"https://api.github.com/users/jefflill/repos","events_url":"https://api.github.com/users/jefflill/events{/privacy}","received_events_url":"https://api.github.com/users/jefflill/received_events","type":"User","site_admin":false},"created_at":"2016-06-16T02:44:30Z","updated_at":"2016-06-16T02:44:30Z","body":"Ooooh, looks like this was assigned the Devil's issue number.  Hopefully there will be no bad luck for anyone! :)"}}
{"actor":{"display_login":"jefflill"}}