{"action":"created","comment":{"url":"https://api.github.com/repos/mono/MonoGame/pulls/comments/22758047","id":22758047,"diff_hunk":"@@ -115,10 +115,26 @@ internal protected override void GraphicsDeviceResetting()\n         protected void SetDataInternal<T>(int offsetInBytes, T[] data, int startIndex, int elementCount, SetDataOptions options) where T : struct\r\n         {\r\n             if (data == null)\r\n-                throw new ArgumentNullException(\"data is null\");\r\n+                throw new ArgumentNullException(\"data\");\r\n             if (data.Length < (startIndex + elementCount))\r\n                 throw new InvalidOperationException(\"The array specified in the data parameter is not the correct size for the amount of data requested.\");\r\n \r\n+            var type = typeof (T);\r\n+            switch (IndexElementSize)\r\n+            {\r\n+                case IndexElementSize.SixteenBits:\r\n+                    if (type != typeof(short) || type != typeof(ushort))\r\n+                    {\r\n+                        throw new ArrayTypeMismatchException(\"Invalid type using when short or ushort need to be used.\");\r\n+                    }\r\n+                    break;\r\n+                case IndexElementSize.ThirtyTwoBits:\r\n+                    if (type != typeof(int) || type != typeof(uint))\r\n+                    {\r\n+                        throw new ArrayTypeMismatchException(\"Invalid type using when int or uint need to be used.\");\r\n+                    }\r\n+                    break;\r\n+            }\r","path":"MonoGame.Framework/Graphics/Vertices/IndexBuffer.cs","position":null,"original_position":60,"commit_id":"bd1a0f94dcd504abc22749d917c54917c9fc1048","original_commit_id":"e5d9c9b93b5be8d29c9a61fca7b4f76ac9784db0","user":{"login":"tomspilman","id":103522,"avatar_url":"https://avatars.githubusercontent.com/u/103522?v=3","gravatar_id":"","url":"https://api.github.com/users/tomspilman","html_url":"https://github.com/tomspilman","followers_url":"https://api.github.com/users/tomspilman/followers","following_url":"https://api.github.com/users/tomspilman/following{/other_user}","gists_url":"https://api.github.com/users/tomspilman/gists{/gist_id}","starred_url":"https://api.github.com/users/tomspilman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomspilman/subscriptions","organizations_url":"https://api.github.com/users/tomspilman/orgs","repos_url":"https://api.github.com/users/tomspilman/repos","events_url":"https://api.github.com/users/tomspilman/events{/privacy}","received_events_url":"https://api.github.com/users/tomspilman/received_events","type":"User","site_admin":false},"body":"> Just notice that incorrect putting calling blue screen very quickly\r\n\r\nI think you mean a crash when calling `SetData`.  Yes... that is what https://github.com/mono/MonoGame/pull/3378 fixed.","created_at":"2015-01-10T10:19:57Z","updated_at":"2015-01-10T10:19:57Z","html_url":"https://github.com/mono/MonoGame/pull/3379#discussion_r22758047","pull_request_url":"https://api.github.com/repos/mono/MonoGame/pulls/3379","_links":{"self":{"href":"https://api.github.com/repos/mono/MonoGame/pulls/comments/22758047"},"html":{"href":"https://github.com/mono/MonoGame/pull/3379#discussion_r22758047"},"pull_request":{"href":"https://api.github.com/repos/mono/MonoGame/pulls/3379"}}},"pull_request":{"url":"https://api.github.com/repos/mono/MonoGame/pulls/3379","id":27146763,"html_url":"https://github.com/mono/MonoGame/pull/3379","diff_url":"https://github.com/mono/MonoGame/pull/3379.diff","patch_url":"https://github.com/mono/MonoGame/pull/3379.patch","issue_url":"https://api.github.com/repos/mono/MonoGame/issues/3379","number":3379,"state":"open","locked":false,"title":"Buffer fixes","user":{"login":"Shqrdx","id":3036176,"avatar_url":"https://avatars.githubusercontent.com/u/3036176?v=3","gravatar_id":"","url":"https://api.github.com/users/Shqrdx","html_url":"https://github.com/Shqrdx","followers_url":"https://api.github.com/users/Shqrdx/followers","following_url":"https://api.github.com/users/Shqrdx/following{/other_user}","gists_url":"https://api.github.com/users/Shqrdx/gists{/gist_id}","starred_url":"https://api.github.com/users/Shqrdx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shqrdx/subscriptions","organizations_url":"https://api.github.com/users/Shqrdx/orgs","repos_url":"https://api.github.com/users/Shqrdx/repos","events_url":"https://api.github.com/users/Shqrdx/events{/privacy}","received_events_url":"https://api.github.com/users/Shqrdx/received_events","type":"User","site_admin":false},"body":"Reopened https://github.com/mono/MonoGame/pull/3376","created_at":"2015-01-10T09:29:25Z","updated_at":"2015-01-10T10:19:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2fe7f758173dd8aa4458b339225026e975061ba4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mono/MonoGame/pulls/3379/commits","review_comments_url":"https://api.github.com/repos/mono/MonoGame/pulls/3379/comments","review_comment_url":"https://api.github.com/repos/mono/MonoGame/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mono/MonoGame/issues/3379/comments","statuses_url":"https://api.github.com/repos/mono/MonoGame/statuses/bd1a0f94dcd504abc22749d917c54917c9fc1048","head":{"label":"Shqrdx:BufferImrovements2","ref":"BufferImrovements2","sha":"bd1a0f94dcd504abc22749d917c54917c9fc1048","user":{"login":"Shqrdx","id":3036176,"avatar_url":"https://avatars.githubusercontent.com/u/3036176?v=3","gravatar_id":"","url":"https://api.github.com/users/Shqrdx","html_url":"https://github.com/Shqrdx","followers_url":"https://api.github.com/users/Shqrdx/followers","following_url":"https://api.github.com/users/Shqrdx/following{/other_user}","gists_url":"https://api.github.com/users/Shqrdx/gists{/gist_id}","starred_url":"https://api.github.com/users/Shqrdx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shqrdx/subscriptions","organizations_url":"https://api.github.com/users/Shqrdx/orgs","repos_url":"https://api.github.com/users/Shqrdx/repos","events_url":"https://api.github.com/users/Shqrdx/events{/privacy}","received_events_url":"https://api.github.com/users/Shqrdx/received_events","type":"User","site_admin":false},"repo":{"id":24952569,"name":"MonoGame","full_name":"Shqrdx/MonoGame","owner":{"login":"Shqrdx","id":3036176,"avatar_url":"https://avatars.githubusercontent.com/u/3036176?v=3","gravatar_id":"","url":"https://api.github.com/users/Shqrdx","html_url":"https://github.com/Shqrdx","followers_url":"https://api.github.com/users/Shqrdx/followers","following_url":"https://api.github.com/users/Shqrdx/following{/other_user}","gists_url":"https://api.github.com/users/Shqrdx/gists{/gist_id}","starred_url":"https://api.github.com/users/Shqrdx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shqrdx/subscriptions","organizations_url":"https://api.github.com/users/Shqrdx/orgs","repos_url":"https://api.github.com/users/Shqrdx/repos","events_url":"https://api.github.com/users/Shqrdx/events{/privacy}","received_events_url":"https://api.github.com/users/Shqrdx/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Shqrdx/MonoGame","description":"One framework for creating powerful cross-platform games.","fork":true,"url":"https://api.github.com/repos/Shqrdx/MonoGame","forks_url":"https://api.github.com/repos/Shqrdx/MonoGame/forks","keys_url":"https://api.github.com/repos/Shqrdx/MonoGame/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shqrdx/MonoGame/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shqrdx/MonoGame/teams","hooks_url":"https://api.github.com/repos/Shqrdx/MonoGame/hooks","issue_events_url":"https://api.github.com/repos/Shqrdx/MonoGame/issues/events{/number}","events_url":"https://api.github.com/repos/Shqrdx/MonoGame/events","assignees_url":"https://api.github.com/repos/Shqrdx/MonoGame/assignees{/user}","branches_url":"https://api.github.com/repos/Shqrdx/MonoGame/branches{/branch}","tags_url":"https://api.github.com/repos/Shqrdx/MonoGame/tags","blobs_url":"https://api.github.com/repos/Shqrdx/MonoGame/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shqrdx/MonoGame/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shqrdx/MonoGame/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shqrdx/MonoGame/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shqrdx/MonoGame/statuses/{sha}","languages_url":"https://api.github.com/repos/Shqrdx/MonoGame/languages","stargazers_url":"https://api.github.com/repos/Shqrdx/MonoGame/stargazers","contributors_url":"https://api.github.com/repos/Shqrdx/MonoGame/contributors","subscribers_url":"https://api.github.com/repos/Shqrdx/MonoGame/subscribers","subscription_url":"https://api.github.com/repos/Shqrdx/MonoGame/subscription","commits_url":"https://api.github.com/repos/Shqrdx/MonoGame/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shqrdx/MonoGame/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shqrdx/MonoGame/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shqrdx/MonoGame/issues/comments/{number}","contents_url":"https://api.github.com/repos/Shqrdx/MonoGame/contents/{+path}","compare_url":"https://api.github.com/repos/Shqrdx/MonoGame/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shqrdx/MonoGame/merges","archive_url":"https://api.github.com/repos/Shqrdx/MonoGame/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shqrdx/MonoGame/downloads","issues_url":"https://api.github.com/repos/Shqrdx/MonoGame/issues{/number}","pulls_url":"https://api.github.com/repos/Shqrdx/MonoGame/pulls{/number}","milestones_url":"https://api.github.com/repos/Shqrdx/MonoGame/milestones{/number}","notifications_url":"https://api.github.com/repos/Shqrdx/MonoGame/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shqrdx/MonoGame/labels{/name}","releases_url":"https://api.github.com/repos/Shqrdx/MonoGame/releases{/id}","created_at":"2014-10-08T17:41:15Z","updated_at":"2014-12-25T19:18:33Z","pushed_at":"2015-01-10T10:16:02Z","git_url":"git://github.com/Shqrdx/MonoGame.git","ssh_url":"git@github.com:Shqrdx/MonoGame.git","clone_url":"https://github.com/Shqrdx/MonoGame.git","svn_url":"https://github.com/Shqrdx/MonoGame","homepage":"http://www.monogame.net","size":48640,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"mono:develop","ref":"develop","sha":"492439c5e859d1477304f8f219f49bcda3fb03be","user":{"login":"mono","id":53395,"avatar_url":"https://avatars.githubusercontent.com/u/53395?v=3","gravatar_id":"","url":"https://api.github.com/users/mono","html_url":"https://github.com/mono","followers_url":"https://api.github.com/users/mono/followers","following_url":"https://api.github.com/users/mono/following{/other_user}","gists_url":"https://api.github.com/users/mono/gists{/gist_id}","starred_url":"https://api.github.com/users/mono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mono/subscriptions","organizations_url":"https://api.github.com/users/mono/orgs","repos_url":"https://api.github.com/users/mono/repos","events_url":"https://api.github.com/users/mono/events{/privacy}","received_events_url":"https://api.github.com/users/mono/received_events","type":"Organization","site_admin":false},"repo":{"id":1579990,"name":"MonoGame","full_name":"mono/MonoGame","owner":{"login":"mono","id":53395,"avatar_url":"https://avatars.githubusercontent.com/u/53395?v=3","gravatar_id":"","url":"https://api.github.com/users/mono","html_url":"https://github.com/mono","followers_url":"https://api.github.com/users/mono/followers","following_url":"https://api.github.com/users/mono/following{/other_user}","gists_url":"https://api.github.com/users/mono/gists{/gist_id}","starred_url":"https://api.github.com/users/mono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mono/subscriptions","organizations_url":"https://api.github.com/users/mono/orgs","repos_url":"https://api.github.com/users/mono/repos","events_url":"https://api.github.com/users/mono/events{/privacy}","received_events_url":"https://api.github.com/users/mono/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mono/MonoGame","description":"One framework for creating powerful cross-platform games.","fork":false,"url":"https://api.github.com/repos/mono/MonoGame","forks_url":"https://api.github.com/repos/mono/MonoGame/forks","keys_url":"https://api.github.com/repos/mono/MonoGame/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mono/MonoGame/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mono/MonoGame/teams","hooks_url":"https://api.github.com/repos/mono/MonoGame/hooks","issue_events_url":"https://api.github.com/repos/mono/MonoGame/issues/events{/number}","events_url":"https://api.github.com/repos/mono/MonoGame/events","assignees_url":"https://api.github.com/repos/mono/MonoGame/assignees{/user}","branches_url":"https://api.github.com/repos/mono/MonoGame/branches{/branch}","tags_url":"https://api.github.com/repos/mono/MonoGame/tags","blobs_url":"https://api.github.com/repos/mono/MonoGame/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mono/MonoGame/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mono/MonoGame/git/refs{/sha}","trees_url":"https://api.github.com/repos/mono/MonoGame/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mono/MonoGame/statuses/{sha}","languages_url":"https://api.github.com/repos/mono/MonoGame/languages","stargazers_url":"https://api.github.com/repos/mono/MonoGame/stargazers","contributors_url":"https://api.github.com/repos/mono/MonoGame/contributors","subscribers_url":"https://api.github.com/repos/mono/MonoGame/subscribers","subscription_url":"https://api.github.com/repos/mono/MonoGame/subscription","commits_url":"https://api.github.com/repos/mono/MonoGame/commits{/sha}","git_commits_url":"https://api.github.com/repos/mono/MonoGame/git/commits{/sha}","comments_url":"https://api.github.com/repos/mono/MonoGame/comments{/number}","issue_comment_url":"https://api.github.com/repos/mono/MonoGame/issues/comments/{number}","contents_url":"https://api.github.com/repos/mono/MonoGame/contents/{+path}","compare_url":"https://api.github.com/repos/mono/MonoGame/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mono/MonoGame/merges","archive_url":"https://api.github.com/repos/mono/MonoGame/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mono/MonoGame/downloads","issues_url":"https://api.github.com/repos/mono/MonoGame/issues{/number}","pulls_url":"https://api.github.com/repos/mono/MonoGame/pulls{/number}","milestones_url":"https://api.github.com/repos/mono/MonoGame/milestones{/number}","notifications_url":"https://api.github.com/repos/mono/MonoGame/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mono/MonoGame/labels{/name}","releases_url":"https://api.github.com/repos/mono/MonoGame/releases{/id}","created_at":"2011-04-07T00:23:40Z","updated_at":"2015-01-10T09:21:52Z","pushed_at":"2015-01-10T09:21:52Z","git_url":"git://github.com/mono/MonoGame.git","ssh_url":"git@github.com:mono/MonoGame.git","clone_url":"https://github.com/mono/MonoGame.git","svn_url":"https://github.com/mono/MonoGame","homepage":"http://www.monogame.net","size":310300,"stargazers_count":2484,"watchers_count":2484,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1417,"mirror_url":null,"open_issues_count":580,"forks":1417,"open_issues":580,"watchers":2484,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/mono/MonoGame/pulls/3379"},"html":{"href":"https://github.com/mono/MonoGame/pull/3379"},"issue":{"href":"https://api.github.com/repos/mono/MonoGame/issues/3379"},"comments":{"href":"https://api.github.com/repos/mono/MonoGame/issues/3379/comments"},"review_comments":{"href":"https://api.github.com/repos/mono/MonoGame/pulls/3379/comments"},"review_comment":{"href":"https://api.github.com/repos/mono/MonoGame/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mono/MonoGame/pulls/3379/commits"},"statuses":{"href":"https://api.github.com/repos/mono/MonoGame/statuses/bd1a0f94dcd504abc22749d917c54917c9fc1048"}}}}