{"action":"opened","number":1,"pull_request":{"url":"https://api.github.com/repos/github/hubot-slack/pulls/1","id":45330622,"html_url":"https://github.com/github/hubot-slack/pull/1","diff_url":"https://github.com/github/hubot-slack/pull/1.diff","patch_url":"https://github.com/github/hubot-slack/pull/1.patch","issue_url":"https://api.github.com/repos/github/hubot-slack/issues/1","number":1,"state":"open","locked":false,"title":"Unexpectedly missing profile when user changes","user":{"login":"technicalpickles","id":159,"avatar_url":"https://avatars.githubusercontent.com/u/159?v=3","gravatar_id":"","url":"https://api.github.com/users/technicalpickles","html_url":"https://github.com/technicalpickles","followers_url":"https://api.github.com/users/technicalpickles/followers","following_url":"https://api.github.com/users/technicalpickles/following{/other_user}","gists_url":"https://api.github.com/users/technicalpickles/gists{/gist_id}","starred_url":"https://api.github.com/users/technicalpickles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/technicalpickles/subscriptions","organizations_url":"https://api.github.com/users/technicalpickles/orgs","repos_url":"https://api.github.com/users/technicalpickles/repos","events_url":"https://api.github.com/users/technicalpickles/events{/privacy}","received_events_url":"https://api.github.com/users/technicalpickles/received_events","type":"User","site_admin":true},"body":"We found hubot not responding one day, and there was an error like:\r\n\r\n```\r\nTypeError: Cannot read property 'email' of undefined\r\n  at SlackBot.userChange (node_modules/hubot-slack/src/slack.coffee:79:7, <js>:113:36)\r\n  at SlackBot.__bind [as userChange] (node_modules/hubot-slack/src/slack.coffee:1:1, <js>:3:61)\r\n  at SlackBot.loggedIn (node_modules/hubot-slack/src/slack.coffee:64:7, <js>:83:28)\r\n  at Client.__bind (node_modules/hubot-slack/src/slack.coffee:1:1, <js>:3:61)\r\n  at Client.EventEmitter.emit (events.js:96:17)\r\n  at Client._onLogin (node_modules/hubot-slack/node_modules/slack-client/src/client.js:100:14)\r\n  at __bind (node_modules/hubot-slack/node_modules/slack-client/src/client.js:2:59)\r\n  at IncomingMessage.Client._apiCall.req.on.callback.ok (node_modules/hubot-slack/node_modules/slack-client/src/client.js:670:22)\r\n```\r\n\r\nThe profile was nil in this case. This PR uses logs the user for debugging and uses the existential operator to check for a profile to prevent a crash (maybe). This is against our master branch which has come changes, so I'll have to do a separate PR to get it fixed upstream once I've confirmed it.","created_at":"2015-09-17T19:22:47Z","updated_at":"2015-09-17T19:22:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/github/hubot-slack/pulls/1/commits","review_comments_url":"https://api.github.com/repos/github/hubot-slack/pulls/1/comments","review_comment_url":"https://api.github.com/repos/github/hubot-slack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/github/hubot-slack/issues/1/comments","statuses_url":"https://api.github.com/repos/github/hubot-slack/statuses/8834f0b3b601077f74a265f3db50fe2f2aa464ca","head":{"label":"github:unexpected-missing-profile","ref":"unexpected-missing-profile","sha":"8834f0b3b601077f74a265f3db50fe2f2aa464ca","user":{"login":"github","id":9919,"avatar_url":"https://avatars.githubusercontent.com/u/9919?v=3","gravatar_id":"","url":"https://api.github.com/users/github","html_url":"https://github.com/github","followers_url":"https://api.github.com/users/github/followers","following_url":"https://api.github.com/users/github/following{/other_user}","gists_url":"https://api.github.com/users/github/gists{/gist_id}","starred_url":"https://api.github.com/users/github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github/subscriptions","organizations_url":"https://api.github.com/users/github/orgs","repos_url":"https://api.github.com/users/github/repos","events_url":"https://api.github.com/users/github/events{/privacy}","received_events_url":"https://api.github.com/users/github/received_events","type":"Organization","site_admin":false},"repo":{"id":42262179,"name":"hubot-slack","full_name":"github/hubot-slack","owner":{"login":"github","id":9919,"avatar_url":"https://avatars.githubusercontent.com/u/9919?v=3","gravatar_id":"","url":"https://api.github.com/users/github","html_url":"https://github.com/github","followers_url":"https://api.github.com/users/github/followers","following_url":"https://api.github.com/users/github/following{/other_user}","gists_url":"https://api.github.com/users/github/gists{/gist_id}","starred_url":"https://api.github.com/users/github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github/subscriptions","organizations_url":"https://api.github.com/users/github/orgs","repos_url":"https://api.github.com/users/github/repos","events_url":"https://api.github.com/users/github/events{/privacy}","received_events_url":"https://api.github.com/users/github/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/github/hubot-slack","description":"","fork":true,"url":"https://api.github.com/repos/github/hubot-slack","forks_url":"https://api.github.com/repos/github/hubot-slack/forks","keys_url":"https://api.github.com/repos/github/hubot-slack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/github/hubot-slack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/github/hubot-slack/teams","hooks_url":"https://api.github.com/repos/github/hubot-slack/hooks","issue_events_url":"https://api.github.com/repos/github/hubot-slack/issues/events{/number}","events_url":"https://api.github.com/repos/github/hubot-slack/events","assignees_url":"https://api.github.com/repos/github/hubot-slack/assignees{/user}","branches_url":"https://api.github.com/repos/github/hubot-slack/branches{/branch}","tags_url":"https://api.github.com/repos/github/hubot-slack/tags","blobs_url":"https://api.github.com/repos/github/hubot-slack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/github/hubot-slack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/github/hubot-slack/git/refs{/sha}","trees_url":"https://api.github.com/repos/github/hubot-slack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/github/hubot-slack/statuses/{sha}","languages_url":"https://api.github.com/repos/github/hubot-slack/languages","stargazers_url":"https://api.github.com/repos/github/hubot-slack/stargazers","contributors_url":"https://api.github.com/repos/github/hubot-slack/contributors","subscribers_url":"https://api.github.com/repos/github/hubot-slack/subscribers","subscription_url":"https://api.github.com/repos/github/hubot-slack/subscription","commits_url":"https://api.github.com/repos/github/hubot-slack/commits{/sha}","git_commits_url":"https://api.github.com/repos/github/hubot-slack/git/commits{/sha}","comments_url":"https://api.github.com/repos/github/hubot-slack/comments{/number}","issue_comment_url":"https://api.github.com/repos/github/hubot-slack/issues/comments{/number}","contents_url":"https://api.github.com/repos/github/hubot-slack/contents/{+path}","compare_url":"https://api.github.com/repos/github/hubot-slack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/github/hubot-slack/merges","archive_url":"https://api.github.com/repos/github/hubot-slack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/github/hubot-slack/downloads","issues_url":"https://api.github.com/repos/github/hubot-slack/issues{/number}","pulls_url":"https://api.github.com/repos/github/hubot-slack/pulls{/number}","milestones_url":"https://api.github.com/repos/github/hubot-slack/milestones{/number}","notifications_url":"https://api.github.com/repos/github/hubot-slack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/github/hubot-slack/labels{/name}","releases_url":"https://api.github.com/repos/github/hubot-slack/releases{/id}","created_at":"2015-09-10T18:16:47Z","updated_at":"2015-09-10T18:16:48Z","pushed_at":"2015-09-17T19:22:47Z","git_url":"git://github.com/github/hubot-slack.git","ssh_url":"git@github.com:github/hubot-slack.git","clone_url":"https://github.com/github/hubot-slack.git","svn_url":"https://github.com/github/hubot-slack","homepage":null,"size":207,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"github:master","ref":"master","sha":"91bd03ea71c8ad7c4d75752d0cbea9d3783d93b2","user":{"login":"github","id":9919,"avatar_url":"https://avatars.githubusercontent.com/u/9919?v=3","gravatar_id":"","url":"https://api.github.com/users/github","html_url":"https://github.com/github","followers_url":"https://api.github.com/users/github/followers","following_url":"https://api.github.com/users/github/following{/other_user}","gists_url":"https://api.github.com/users/github/gists{/gist_id}","starred_url":"https://api.github.com/users/github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github/subscriptions","organizations_url":"https://api.github.com/users/github/orgs","repos_url":"https://api.github.com/users/github/repos","events_url":"https://api.github.com/users/github/events{/privacy}","received_events_url":"https://api.github.com/users/github/received_events","type":"Organization","site_admin":false},"repo":{"id":42262179,"name":"hubot-slack","full_name":"github/hubot-slack","owner":{"login":"github","id":9919,"avatar_url":"https://avatars.githubusercontent.com/u/9919?v=3","gravatar_id":"","url":"https://api.github.com/users/github","html_url":"https://github.com/github","followers_url":"https://api.github.com/users/github/followers","following_url":"https://api.github.com/users/github/following{/other_user}","gists_url":"https://api.github.com/users/github/gists{/gist_id}","starred_url":"https://api.github.com/users/github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github/subscriptions","organizations_url":"https://api.github.com/users/github/orgs","repos_url":"https://api.github.com/users/github/repos","events_url":"https://api.github.com/users/github/events{/privacy}","received_events_url":"https://api.github.com/users/github/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/github/hubot-slack","description":"","fork":true,"url":"https://api.github.com/repos/github/hubot-slack","forks_url":"https://api.github.com/repos/github/hubot-slack/forks","keys_url":"https://api.github.com/repos/github/hubot-slack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/github/hubot-slack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/github/hubot-slack/teams","hooks_url":"https://api.github.com/repos/github/hubot-slack/hooks","issue_events_url":"https://api.github.com/repos/github/hubot-slack/issues/events{/number}","events_url":"https://api.github.com/repos/github/hubot-slack/events","assignees_url":"https://api.github.com/repos/github/hubot-slack/assignees{/user}","branches_url":"https://api.github.com/repos/github/hubot-slack/branches{/branch}","tags_url":"https://api.github.com/repos/github/hubot-slack/tags","blobs_url":"https://api.github.com/repos/github/hubot-slack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/github/hubot-slack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/github/hubot-slack/git/refs{/sha}","trees_url":"https://api.github.com/repos/github/hubot-slack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/github/hubot-slack/statuses/{sha}","languages_url":"https://api.github.com/repos/github/hubot-slack/languages","stargazers_url":"https://api.github.com/repos/github/hubot-slack/stargazers","contributors_url":"https://api.github.com/repos/github/hubot-slack/contributors","subscribers_url":"https://api.github.com/repos/github/hubot-slack/subscribers","subscription_url":"https://api.github.com/repos/github/hubot-slack/subscription","commits_url":"https://api.github.com/repos/github/hubot-slack/commits{/sha}","git_commits_url":"https://api.github.com/repos/github/hubot-slack/git/commits{/sha}","comments_url":"https://api.github.com/repos/github/hubot-slack/comments{/number}","issue_comment_url":"https://api.github.com/repos/github/hubot-slack/issues/comments{/number}","contents_url":"https://api.github.com/repos/github/hubot-slack/contents/{+path}","compare_url":"https://api.github.com/repos/github/hubot-slack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/github/hubot-slack/merges","archive_url":"https://api.github.com/repos/github/hubot-slack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/github/hubot-slack/downloads","issues_url":"https://api.github.com/repos/github/hubot-slack/issues{/number}","pulls_url":"https://api.github.com/repos/github/hubot-slack/pulls{/number}","milestones_url":"https://api.github.com/repos/github/hubot-slack/milestones{/number}","notifications_url":"https://api.github.com/repos/github/hubot-slack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/github/hubot-slack/labels{/name}","releases_url":"https://api.github.com/repos/github/hubot-slack/releases{/id}","created_at":"2015-09-10T18:16:47Z","updated_at":"2015-09-10T18:16:48Z","pushed_at":"2015-09-17T19:22:47Z","git_url":"git://github.com/github/hubot-slack.git","ssh_url":"git@github.com:github/hubot-slack.git","clone_url":"https://github.com/github/hubot-slack.git","svn_url":"https://github.com/github/hubot-slack","homepage":null,"size":207,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/github/hubot-slack/pulls/1"},"html":{"href":"https://github.com/github/hubot-slack/pull/1"},"issue":{"href":"https://api.github.com/repos/github/hubot-slack/issues/1"},"comments":{"href":"https://api.github.com/repos/github/hubot-slack/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/github/hubot-slack/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/github/hubot-slack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/github/hubot-slack/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/github/hubot-slack/statuses/8834f0b3b601077f74a265f3db50fe2f2aa464ca"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":3,"deletions":1,"changed_files":1}}