{"action":"closed","issue":{"url":"https://api.github.com/repos/vknet/vk/issues/345","repository_url":"https://api.github.com/repos/vknet/vk","labels_url":"https://api.github.com/repos/vknet/vk/issues/345/labels{/name}","comments_url":"https://api.github.com/repos/vknet/vk/issues/345/comments","events_url":"https://api.github.com/repos/vknet/vk/issues/345/events","html_url":"https://github.com/vknet/vk/issues/345","id":192314520,"number":345,"title":"WallGetObject handling 1 returned item (object reference exception)","user":{"login":"p4rnicke","id":14051966,"avatar_url":"https://avatars1.githubusercontent.com/u/14051966?v=3","gravatar_id":"","url":"https://api.github.com/users/p4rnicke","html_url":"https://github.com/p4rnicke","followers_url":"https://api.github.com/users/p4rnicke/followers","following_url":"https://api.github.com/users/p4rnicke/following{/other_user}","gists_url":"https://api.github.com/users/p4rnicke/gists{/gist_id}","starred_url":"https://api.github.com/users/p4rnicke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p4rnicke/subscriptions","organizations_url":"https://api.github.com/users/p4rnicke/orgs","repos_url":"https://api.github.com/users/p4rnicke/repos","events_url":"https://api.github.com/users/p4rnicke/events{/privacy}","received_events_url":"https://api.github.com/users/p4rnicke/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-29T15:35:14Z","updated_at":"2017-03-17T14:05:11Z","closed_at":"2017-03-17T14:05:11Z","body":"The FromJson function at Model\\WallGetObject.cs does not handle correctly if wall.getbyid returns 1 item.\r\nIn fact it is not your fault but VK, it is not returning the count field if 1 item is returned.\r\nI changed like this in my fork:\r\nwallGetObject = new WallGetObject\r\n                {\r\n                    WallPosts = response[\"items\"].ToReadOnlyCollectionOf<Post>(r => r),\r\n                    Profiles = response[\"profiles\"].ToReadOnlyCollectionOf<User>(r => r),\r\n                    Groups = response[\"groups\"].ToReadOnlyCollectionOf<Group>(r => r)\r\n                };\r\n                if (response[\"count\"] != null)\r\n                {\r\n                    wallGetObject.TotalCount = response[\"count\"];\r\n                }\r\n                else\r\n                {\r\n                    wallGetObject.TotalCount = 1;\r\n                }\r\n"}}
{"actor":{"display_login":"inyutin-maxim"}}