{"action":"created","comment":{"url":"https://api.github.com/repos/ToothlessGear/node-gcm/pulls/comments/45734170","id":45734170,"diff_hunk":"@@ -29,18 +29,27 @@ var parseAndRespond = function(resBody, callback) {\n function extractRecipient(recipient) {\n     var validKeys = ['registrationIds', 'registrationTokens', 'topic', 'notificationKey'];\n     var theRecipient;\n-\n-    validKeys.forEach(function(key) {\n-        if (recipient[key]) {\n+    var err = null;\n+    var key = null;","path":"lib/sender.js","position":8,"original_position":8,"commit_id":"ed2903abaa12249d4a3a3d37bceb91e3f063a2a9","original_commit_id":"ed2903abaa12249d4a3a3d37bceb91e3f063a2a9","user":{"login":"hypesystem","id":859106,"avatar_url":"https://avatars.githubusercontent.com/u/859106?v=3","gravatar_id":"","url":"https://api.github.com/users/hypesystem","html_url":"https://github.com/hypesystem","followers_url":"https://api.github.com/users/hypesystem/followers","following_url":"https://api.github.com/users/hypesystem/following{/other_user}","gists_url":"https://api.github.com/users/hypesystem/gists{/gist_id}","starred_url":"https://api.github.com/users/hypesystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypesystem/subscriptions","organizations_url":"https://api.github.com/users/hypesystem/orgs","repos_url":"https://api.github.com/users/hypesystem/repos","events_url":"https://api.github.com/users/hypesystem/events{/privacy}","received_events_url":"https://api.github.com/users/hypesystem/received_events","type":"User","site_admin":false},"body":"Also when instantiating, there's no reason to set the variables to null.\r\n\r\n```js\r\nvar err; // <-- instantiates `err`, set to `undefined`\r\n```","created_at":"2015-11-24T13:29:24Z","updated_at":"2015-11-24T13:29:24Z","html_url":"https://github.com/ToothlessGear/node-gcm/pull/185#discussion_r45734170","pull_request_url":"https://api.github.com/repos/ToothlessGear/node-gcm/pulls/185","_links":{"self":{"href":"https://api.github.com/repos/ToothlessGear/node-gcm/pulls/comments/45734170"},"html":{"href":"https://github.com/ToothlessGear/node-gcm/pull/185#discussion_r45734170"},"pull_request":{"href":"https://api.github.com/repos/ToothlessGear/node-gcm/pulls/185"}}},"pull_request":{"url":"https://api.github.com/repos/ToothlessGear/node-gcm/pulls/185","id":51543367,"html_url":"https://github.com/ToothlessGear/node-gcm/pull/185","diff_url":"https://github.com/ToothlessGear/node-gcm/pull/185.diff","patch_url":"https://github.com/ToothlessGear/node-gcm/pull/185.patch","issue_url":"https://api.github.com/repos/ToothlessGear/node-gcm/issues/185","number":185,"state":"open","locked":false,"title":"Found an issue which causing the App crash.","user":{"login":"inampaki","id":4215868,"avatar_url":"https://avatars.githubusercontent.com/u/4215868?v=3","gravatar_id":"","url":"https://api.github.com/users/inampaki","html_url":"https://github.com/inampaki","followers_url":"https://api.github.com/users/inampaki/followers","following_url":"https://api.github.com/users/inampaki/following{/other_user}","gists_url":"https://api.github.com/users/inampaki/gists{/gist_id}","starred_url":"https://api.github.com/users/inampaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inampaki/subscriptions","organizations_url":"https://api.github.com/users/inampaki/orgs","repos_url":"https://api.github.com/users/inampaki/repos","events_url":"https://api.github.com/users/inampaki/events{/privacy}","received_events_url":"https://api.github.com/users/inampaki/received_events","type":"User","site_admin":false},"body":"Resolved an issue which crashing the application that when string is passed to the object in 2nd argument instead of Array\r\n\r\n```javascript\r\nsender.send(message, { registrationTokens: \"device id\"}, function (err, response) {\r\n});\r\n```","created_at":"2015-11-23T16:11:49Z","updated_at":"2015-11-24T13:29:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"833894530b567ebfad845618957e2a6da9f73916","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ToothlessGear/node-gcm/pulls/185/commits","review_comments_url":"https://api.github.com/repos/ToothlessGear/node-gcm/pulls/185/comments","review_comment_url":"https://api.github.com/repos/ToothlessGear/node-gcm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ToothlessGear/node-gcm/issues/185/comments","statuses_url":"https://api.github.com/repos/ToothlessGear/node-gcm/statuses/ed2903abaa12249d4a3a3d37bceb91e3f063a2a9","head":{"label":"inampaki:master","ref":"master","sha":"ed2903abaa12249d4a3a3d37bceb91e3f063a2a9","user":{"login":"inampaki","id":4215868,"avatar_url":"https://avatars.githubusercontent.com/u/4215868?v=3","gravatar_id":"","url":"https://api.github.com/users/inampaki","html_url":"https://github.com/inampaki","followers_url":"https://api.github.com/users/inampaki/followers","following_url":"https://api.github.com/users/inampaki/following{/other_user}","gists_url":"https://api.github.com/users/inampaki/gists{/gist_id}","starred_url":"https://api.github.com/users/inampaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inampaki/subscriptions","organizations_url":"https://api.github.com/users/inampaki/orgs","repos_url":"https://api.github.com/users/inampaki/repos","events_url":"https://api.github.com/users/inampaki/events{/privacy}","received_events_url":"https://api.github.com/users/inampaki/received_events","type":"User","site_admin":false},"repo":{"id":46730318,"name":"node-gcm","full_name":"inampaki/node-gcm","owner":{"login":"inampaki","id":4215868,"avatar_url":"https://avatars.githubusercontent.com/u/4215868?v=3","gravatar_id":"","url":"https://api.github.com/users/inampaki","html_url":"https://github.com/inampaki","followers_url":"https://api.github.com/users/inampaki/followers","following_url":"https://api.github.com/users/inampaki/following{/other_user}","gists_url":"https://api.github.com/users/inampaki/gists{/gist_id}","starred_url":"https://api.github.com/users/inampaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inampaki/subscriptions","organizations_url":"https://api.github.com/users/inampaki/orgs","repos_url":"https://api.github.com/users/inampaki/repos","events_url":"https://api.github.com/users/inampaki/events{/privacy}","received_events_url":"https://api.github.com/users/inampaki/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/inampaki/node-gcm","description":"A NodeJS wrapper library port to send data to Android devices via Google Cloud Messaging","fork":true,"url":"https://api.github.com/repos/inampaki/node-gcm","forks_url":"https://api.github.com/repos/inampaki/node-gcm/forks","keys_url":"https://api.github.com/repos/inampaki/node-gcm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/inampaki/node-gcm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/inampaki/node-gcm/teams","hooks_url":"https://api.github.com/repos/inampaki/node-gcm/hooks","issue_events_url":"https://api.github.com/repos/inampaki/node-gcm/issues/events{/number}","events_url":"https://api.github.com/repos/inampaki/node-gcm/events","assignees_url":"https://api.github.com/repos/inampaki/node-gcm/assignees{/user}","branches_url":"https://api.github.com/repos/inampaki/node-gcm/branches{/branch}","tags_url":"https://api.github.com/repos/inampaki/node-gcm/tags","blobs_url":"https://api.github.com/repos/inampaki/node-gcm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/inampaki/node-gcm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/inampaki/node-gcm/git/refs{/sha}","trees_url":"https://api.github.com/repos/inampaki/node-gcm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/inampaki/node-gcm/statuses/{sha}","languages_url":"https://api.github.com/repos/inampaki/node-gcm/languages","stargazers_url":"https://api.github.com/repos/inampaki/node-gcm/stargazers","contributors_url":"https://api.github.com/repos/inampaki/node-gcm/contributors","subscribers_url":"https://api.github.com/repos/inampaki/node-gcm/subscribers","subscription_url":"https://api.github.com/repos/inampaki/node-gcm/subscription","commits_url":"https://api.github.com/repos/inampaki/node-gcm/commits{/sha}","git_commits_url":"https://api.github.com/repos/inampaki/node-gcm/git/commits{/sha}","comments_url":"https://api.github.com/repos/inampaki/node-gcm/comments{/number}","issue_comment_url":"https://api.github.com/repos/inampaki/node-gcm/issues/comments{/number}","contents_url":"https://api.github.com/repos/inampaki/node-gcm/contents/{+path}","compare_url":"https://api.github.com/repos/inampaki/node-gcm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/inampaki/node-gcm/merges","archive_url":"https://api.github.com/repos/inampaki/node-gcm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/inampaki/node-gcm/downloads","issues_url":"https://api.github.com/repos/inampaki/node-gcm/issues{/number}","pulls_url":"https://api.github.com/repos/inampaki/node-gcm/pulls{/number}","milestones_url":"https://api.github.com/repos/inampaki/node-gcm/milestones{/number}","notifications_url":"https://api.github.com/repos/inampaki/node-gcm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/inampaki/node-gcm/labels{/name}","releases_url":"https://api.github.com/repos/inampaki/node-gcm/releases{/id}","created_at":"2015-11-23T15:44:49Z","updated_at":"2015-11-23T15:44:50Z","pushed_at":"2015-11-24T11:21:58Z","git_url":"git://github.com/inampaki/node-gcm.git","ssh_url":"git@github.com:inampaki/node-gcm.git","clone_url":"https://github.com/inampaki/node-gcm.git","svn_url":"https://github.com/inampaki/node-gcm","homepage":"https://github.com/ToothlessGear/node-gcm","size":229,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ToothlessGear:master","ref":"master","sha":"e71405c812892b63b8d673f071874a515409c243","user":{"login":"ToothlessGear","id":1630038,"avatar_url":"https://avatars.githubusercontent.com/u/1630038?v=3","gravatar_id":"","url":"https://api.github.com/users/ToothlessGear","html_url":"https://github.com/ToothlessGear","followers_url":"https://api.github.com/users/ToothlessGear/followers","following_url":"https://api.github.com/users/ToothlessGear/following{/other_user}","gists_url":"https://api.github.com/users/ToothlessGear/gists{/gist_id}","starred_url":"https://api.github.com/users/ToothlessGear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ToothlessGear/subscriptions","organizations_url":"https://api.github.com/users/ToothlessGear/orgs","repos_url":"https://api.github.com/users/ToothlessGear/repos","events_url":"https://api.github.com/users/ToothlessGear/events{/privacy}","received_events_url":"https://api.github.com/users/ToothlessGear/received_events","type":"User","site_admin":false},"repo":{"id":4846607,"name":"node-gcm","full_name":"ToothlessGear/node-gcm","owner":{"login":"ToothlessGear","id":1630038,"avatar_url":"https://avatars.githubusercontent.com/u/1630038?v=3","gravatar_id":"","url":"https://api.github.com/users/ToothlessGear","html_url":"https://github.com/ToothlessGear","followers_url":"https://api.github.com/users/ToothlessGear/followers","following_url":"https://api.github.com/users/ToothlessGear/following{/other_user}","gists_url":"https://api.github.com/users/ToothlessGear/gists{/gist_id}","starred_url":"https://api.github.com/users/ToothlessGear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ToothlessGear/subscriptions","organizations_url":"https://api.github.com/users/ToothlessGear/orgs","repos_url":"https://api.github.com/users/ToothlessGear/repos","events_url":"https://api.github.com/users/ToothlessGear/events{/privacy}","received_events_url":"https://api.github.com/users/ToothlessGear/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ToothlessGear/node-gcm","description":"A NodeJS wrapper library port to send data to Android devices via Google Cloud Messaging","fork":false,"url":"https://api.github.com/repos/ToothlessGear/node-gcm","forks_url":"https://api.github.com/repos/ToothlessGear/node-gcm/forks","keys_url":"https://api.github.com/repos/ToothlessGear/node-gcm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ToothlessGear/node-gcm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ToothlessGear/node-gcm/teams","hooks_url":"https://api.github.com/repos/ToothlessGear/node-gcm/hooks","issue_events_url":"https://api.github.com/repos/ToothlessGear/node-gcm/issues/events{/number}","events_url":"https://api.github.com/repos/ToothlessGear/node-gcm/events","assignees_url":"https://api.github.com/repos/ToothlessGear/node-gcm/assignees{/user}","branches_url":"https://api.github.com/repos/ToothlessGear/node-gcm/branches{/branch}","tags_url":"https://api.github.com/repos/ToothlessGear/node-gcm/tags","blobs_url":"https://api.github.com/repos/ToothlessGear/node-gcm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ToothlessGear/node-gcm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ToothlessGear/node-gcm/git/refs{/sha}","trees_url":"https://api.github.com/repos/ToothlessGear/node-gcm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ToothlessGear/node-gcm/statuses/{sha}","languages_url":"https://api.github.com/repos/ToothlessGear/node-gcm/languages","stargazers_url":"https://api.github.com/repos/ToothlessGear/node-gcm/stargazers","contributors_url":"https://api.github.com/repos/ToothlessGear/node-gcm/contributors","subscribers_url":"https://api.github.com/repos/ToothlessGear/node-gcm/subscribers","subscription_url":"https://api.github.com/repos/ToothlessGear/node-gcm/subscription","commits_url":"https://api.github.com/repos/ToothlessGear/node-gcm/commits{/sha}","git_commits_url":"https://api.github.com/repos/ToothlessGear/node-gcm/git/commits{/sha}","comments_url":"https://api.github.com/repos/ToothlessGear/node-gcm/comments{/number}","issue_comment_url":"https://api.github.com/repos/ToothlessGear/node-gcm/issues/comments{/number}","contents_url":"https://api.github.com/repos/ToothlessGear/node-gcm/contents/{+path}","compare_url":"https://api.github.com/repos/ToothlessGear/node-gcm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ToothlessGear/node-gcm/merges","archive_url":"https://api.github.com/repos/ToothlessGear/node-gcm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ToothlessGear/node-gcm/downloads","issues_url":"https://api.github.com/repos/ToothlessGear/node-gcm/issues{/number}","pulls_url":"https://api.github.com/repos/ToothlessGear/node-gcm/pulls{/number}","milestones_url":"https://api.github.com/repos/ToothlessGear/node-gcm/milestones{/number}","notifications_url":"https://api.github.com/repos/ToothlessGear/node-gcm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ToothlessGear/node-gcm/labels{/name}","releases_url":"https://api.github.com/repos/ToothlessGear/node-gcm/releases{/id}","created_at":"2012-07-01T00:04:03Z","updated_at":"2015-11-24T02:33:28Z","pushed_at":"2015-11-24T11:21:59Z","git_url":"git://github.com/ToothlessGear/node-gcm.git","ssh_url":"git@github.com:ToothlessGear/node-gcm.git","clone_url":"https://github.com/ToothlessGear/node-gcm.git","svn_url":"https://github.com/ToothlessGear/node-gcm","homepage":"https://github.com/ToothlessGear/node-gcm","size":292,"stargazers_count":682,"watchers_count":682,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":132,"mirror_url":null,"open_issues_count":24,"forks":132,"open_issues":24,"watchers":682,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ToothlessGear/node-gcm/pulls/185"},"html":{"href":"https://github.com/ToothlessGear/node-gcm/pull/185"},"issue":{"href":"https://api.github.com/repos/ToothlessGear/node-gcm/issues/185"},"comments":{"href":"https://api.github.com/repos/ToothlessGear/node-gcm/issues/185/comments"},"review_comments":{"href":"https://api.github.com/repos/ToothlessGear/node-gcm/pulls/185/comments"},"review_comment":{"href":"https://api.github.com/repos/ToothlessGear/node-gcm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ToothlessGear/node-gcm/pulls/185/commits"},"statuses":{"href":"https://api.github.com/repos/ToothlessGear/node-gcm/statuses/ed2903abaa12249d4a3a3d37bceb91e3f063a2a9"}}}}