{"action":"created","comment":{"url":"https://api.github.com/repos/fastlane/spaceship/pulls/comments/47128678","id":47128678,"diff_hunk":"@@ -247,10 +247,12 @@ def send_request(method, url_or_path, params, headers, &block)\n     end\n \n     def parse_response(response, expected_key = nil)\n-      if expected_key\n-        content = response.body[expected_key]\n+      content = if response.body","path":"lib/spaceship/client.rb","position":6,"original_position":6,"commit_id":"d148d80dd63db7a5aaa8a2eb481ecb7b0b975269","original_commit_id":"d148d80dd63db7a5aaa8a2eb481ecb7b0b975269","user":{"login":"KrauseFx","id":869950,"avatar_url":"https://avatars.githubusercontent.com/u/869950?v=3","gravatar_id":"","url":"https://api.github.com/users/KrauseFx","html_url":"https://github.com/KrauseFx","followers_url":"https://api.github.com/users/KrauseFx/followers","following_url":"https://api.github.com/users/KrauseFx/following{/other_user}","gists_url":"https://api.github.com/users/KrauseFx/gists{/gist_id}","starred_url":"https://api.github.com/users/KrauseFx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KrauseFx/subscriptions","organizations_url":"https://api.github.com/users/KrauseFx/orgs","repos_url":"https://api.github.com/users/KrauseFx/repos","events_url":"https://api.github.com/users/KrauseFx/events{/privacy}","received_events_url":"https://api.github.com/users/KrauseFx/received_events","type":"User","site_admin":false},"body":"In general we try to avoid the use of the return value of the `if` statement. Could you rewrite it so it's easier for non-Ruby developers to understand?","created_at":"2015-12-09T18:14:30Z","updated_at":"2015-12-09T18:14:30Z","html_url":"https://github.com/fastlane/spaceship/pull/192#discussion_r47128678","pull_request_url":"https://api.github.com/repos/fastlane/spaceship/pulls/192","_links":{"self":{"href":"https://api.github.com/repos/fastlane/spaceship/pulls/comments/47128678"},"html":{"href":"https://github.com/fastlane/spaceship/pull/192#discussion_r47128678"},"pull_request":{"href":"https://api.github.com/repos/fastlane/spaceship/pulls/192"}}},"pull_request":{"url":"https://api.github.com/repos/fastlane/spaceship/pulls/192","id":53089559,"html_url":"https://github.com/fastlane/spaceship/pull/192","diff_url":"https://github.com/fastlane/spaceship/pull/192.diff","patch_url":"https://github.com/fastlane/spaceship/pull/192.patch","issue_url":"https://api.github.com/repos/fastlane/spaceship/issues/192","number":192,"state":"open","locked":false,"title":"Properly safeguard against a nil response body when parsing a response","user":{"login":"andrewpage","id":3052811,"avatar_url":"https://avatars.githubusercontent.com/u/3052811?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewpage","html_url":"https://github.com/andrewpage","followers_url":"https://api.github.com/users/andrewpage/followers","following_url":"https://api.github.com/users/andrewpage/following{/other_user}","gists_url":"https://api.github.com/users/andrewpage/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewpage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewpage/subscriptions","organizations_url":"https://api.github.com/users/andrewpage/orgs","repos_url":"https://api.github.com/users/andrewpage/repos","events_url":"https://api.github.com/users/andrewpage/events{/privacy}","received_events_url":"https://api.github.com/users/andrewpage/received_events","type":"User","site_admin":false},"body":"`Spaceship::Client#parse_response` attempted to safeguard against a nil `response.body` but it was not properly implemented.\r\n\r\nIf `response.body[expected_key]` turned out to be nil, we were safe. However, if `response.body` *itself* was nil, we would get an error when trying to access `response.body[expected_key]`. This change safeguards against that.\r\n\r\n*In response to [this](https://github.com/fastlane/spaceship/issues/189) issue.*","created_at":"2015-12-09T08:31:22Z","updated_at":"2015-12-09T18:14:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0b235c74454e524d7b55fccde03cfee0bb904569","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fastlane/spaceship/pulls/192/commits","review_comments_url":"https://api.github.com/repos/fastlane/spaceship/pulls/192/comments","review_comment_url":"https://api.github.com/repos/fastlane/spaceship/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fastlane/spaceship/issues/192/comments","statuses_url":"https://api.github.com/repos/fastlane/spaceship/statuses/d148d80dd63db7a5aaa8a2eb481ecb7b0b975269","head":{"label":"andrewpage:andrew-safeguard-nil-response","ref":"andrew-safeguard-nil-response","sha":"d148d80dd63db7a5aaa8a2eb481ecb7b0b975269","user":{"login":"andrewpage","id":3052811,"avatar_url":"https://avatars.githubusercontent.com/u/3052811?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewpage","html_url":"https://github.com/andrewpage","followers_url":"https://api.github.com/users/andrewpage/followers","following_url":"https://api.github.com/users/andrewpage/following{/other_user}","gists_url":"https://api.github.com/users/andrewpage/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewpage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewpage/subscriptions","organizations_url":"https://api.github.com/users/andrewpage/orgs","repos_url":"https://api.github.com/users/andrewpage/repos","events_url":"https://api.github.com/users/andrewpage/events{/privacy}","received_events_url":"https://api.github.com/users/andrewpage/received_events","type":"User","site_admin":false},"repo":{"id":47678333,"name":"spaceship","full_name":"andrewpage/spaceship","owner":{"login":"andrewpage","id":3052811,"avatar_url":"https://avatars.githubusercontent.com/u/3052811?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewpage","html_url":"https://github.com/andrewpage","followers_url":"https://api.github.com/users/andrewpage/followers","following_url":"https://api.github.com/users/andrewpage/following{/other_user}","gists_url":"https://api.github.com/users/andrewpage/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewpage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewpage/subscriptions","organizations_url":"https://api.github.com/users/andrewpage/orgs","repos_url":"https://api.github.com/users/andrewpage/repos","events_url":"https://api.github.com/users/andrewpage/events{/privacy}","received_events_url":"https://api.github.com/users/andrewpage/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andrewpage/spaceship","description":"Ruby library to access the Apple Dev Center and iTunes Connect","fork":true,"url":"https://api.github.com/repos/andrewpage/spaceship","forks_url":"https://api.github.com/repos/andrewpage/spaceship/forks","keys_url":"https://api.github.com/repos/andrewpage/spaceship/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andrewpage/spaceship/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andrewpage/spaceship/teams","hooks_url":"https://api.github.com/repos/andrewpage/spaceship/hooks","issue_events_url":"https://api.github.com/repos/andrewpage/spaceship/issues/events{/number}","events_url":"https://api.github.com/repos/andrewpage/spaceship/events","assignees_url":"https://api.github.com/repos/andrewpage/spaceship/assignees{/user}","branches_url":"https://api.github.com/repos/andrewpage/spaceship/branches{/branch}","tags_url":"https://api.github.com/repos/andrewpage/spaceship/tags","blobs_url":"https://api.github.com/repos/andrewpage/spaceship/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andrewpage/spaceship/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andrewpage/spaceship/git/refs{/sha}","trees_url":"https://api.github.com/repos/andrewpage/spaceship/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andrewpage/spaceship/statuses/{sha}","languages_url":"https://api.github.com/repos/andrewpage/spaceship/languages","stargazers_url":"https://api.github.com/repos/andrewpage/spaceship/stargazers","contributors_url":"https://api.github.com/repos/andrewpage/spaceship/contributors","subscribers_url":"https://api.github.com/repos/andrewpage/spaceship/subscribers","subscription_url":"https://api.github.com/repos/andrewpage/spaceship/subscription","commits_url":"https://api.github.com/repos/andrewpage/spaceship/commits{/sha}","git_commits_url":"https://api.github.com/repos/andrewpage/spaceship/git/commits{/sha}","comments_url":"https://api.github.com/repos/andrewpage/spaceship/comments{/number}","issue_comment_url":"https://api.github.com/repos/andrewpage/spaceship/issues/comments{/number}","contents_url":"https://api.github.com/repos/andrewpage/spaceship/contents/{+path}","compare_url":"https://api.github.com/repos/andrewpage/spaceship/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andrewpage/spaceship/merges","archive_url":"https://api.github.com/repos/andrewpage/spaceship/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andrewpage/spaceship/downloads","issues_url":"https://api.github.com/repos/andrewpage/spaceship/issues{/number}","pulls_url":"https://api.github.com/repos/andrewpage/spaceship/pulls{/number}","milestones_url":"https://api.github.com/repos/andrewpage/spaceship/milestones{/number}","notifications_url":"https://api.github.com/repos/andrewpage/spaceship/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andrewpage/spaceship/labels{/name}","releases_url":"https://api.github.com/repos/andrewpage/spaceship/releases{/id}","created_at":"2015-12-09T08:25:35Z","updated_at":"2015-12-09T08:25:36Z","pushed_at":"2015-12-09T08:29:15Z","git_url":"git://github.com/andrewpage/spaceship.git","ssh_url":"git@github.com:andrewpage/spaceship.git","clone_url":"https://github.com/andrewpage/spaceship.git","svn_url":"https://github.com/andrewpage/spaceship","homepage":"https://spaceship.airforce","size":1604,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"fastlane:master","ref":"master","sha":"d610ea61d71bff09529408a6fe24ebabefc09ced","user":{"login":"fastlane","id":11098337,"avatar_url":"https://avatars.githubusercontent.com/u/11098337?v=3","gravatar_id":"","url":"https://api.github.com/users/fastlane","html_url":"https://github.com/fastlane","followers_url":"https://api.github.com/users/fastlane/followers","following_url":"https://api.github.com/users/fastlane/following{/other_user}","gists_url":"https://api.github.com/users/fastlane/gists{/gist_id}","starred_url":"https://api.github.com/users/fastlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastlane/subscriptions","organizations_url":"https://api.github.com/users/fastlane/orgs","repos_url":"https://api.github.com/users/fastlane/repos","events_url":"https://api.github.com/users/fastlane/events{/privacy}","received_events_url":"https://api.github.com/users/fastlane/received_events","type":"Organization","site_admin":false},"repo":{"id":33789738,"name":"spaceship","full_name":"fastlane/spaceship","owner":{"login":"fastlane","id":11098337,"avatar_url":"https://avatars.githubusercontent.com/u/11098337?v=3","gravatar_id":"","url":"https://api.github.com/users/fastlane","html_url":"https://github.com/fastlane","followers_url":"https://api.github.com/users/fastlane/followers","following_url":"https://api.github.com/users/fastlane/following{/other_user}","gists_url":"https://api.github.com/users/fastlane/gists{/gist_id}","starred_url":"https://api.github.com/users/fastlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastlane/subscriptions","organizations_url":"https://api.github.com/users/fastlane/orgs","repos_url":"https://api.github.com/users/fastlane/repos","events_url":"https://api.github.com/users/fastlane/events{/privacy}","received_events_url":"https://api.github.com/users/fastlane/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fastlane/spaceship","description":"Ruby library to access the Apple Dev Center and iTunes Connect","fork":false,"url":"https://api.github.com/repos/fastlane/spaceship","forks_url":"https://api.github.com/repos/fastlane/spaceship/forks","keys_url":"https://api.github.com/repos/fastlane/spaceship/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fastlane/spaceship/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fastlane/spaceship/teams","hooks_url":"https://api.github.com/repos/fastlane/spaceship/hooks","issue_events_url":"https://api.github.com/repos/fastlane/spaceship/issues/events{/number}","events_url":"https://api.github.com/repos/fastlane/spaceship/events","assignees_url":"https://api.github.com/repos/fastlane/spaceship/assignees{/user}","branches_url":"https://api.github.com/repos/fastlane/spaceship/branches{/branch}","tags_url":"https://api.github.com/repos/fastlane/spaceship/tags","blobs_url":"https://api.github.com/repos/fastlane/spaceship/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fastlane/spaceship/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fastlane/spaceship/git/refs{/sha}","trees_url":"https://api.github.com/repos/fastlane/spaceship/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fastlane/spaceship/statuses/{sha}","languages_url":"https://api.github.com/repos/fastlane/spaceship/languages","stargazers_url":"https://api.github.com/repos/fastlane/spaceship/stargazers","contributors_url":"https://api.github.com/repos/fastlane/spaceship/contributors","subscribers_url":"https://api.github.com/repos/fastlane/spaceship/subscribers","subscription_url":"https://api.github.com/repos/fastlane/spaceship/subscription","commits_url":"https://api.github.com/repos/fastlane/spaceship/commits{/sha}","git_commits_url":"https://api.github.com/repos/fastlane/spaceship/git/commits{/sha}","comments_url":"https://api.github.com/repos/fastlane/spaceship/comments{/number}","issue_comment_url":"https://api.github.com/repos/fastlane/spaceship/issues/comments{/number}","contents_url":"https://api.github.com/repos/fastlane/spaceship/contents/{+path}","compare_url":"https://api.github.com/repos/fastlane/spaceship/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fastlane/spaceship/merges","archive_url":"https://api.github.com/repos/fastlane/spaceship/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fastlane/spaceship/downloads","issues_url":"https://api.github.com/repos/fastlane/spaceship/issues{/number}","pulls_url":"https://api.github.com/repos/fastlane/spaceship/pulls{/number}","milestones_url":"https://api.github.com/repos/fastlane/spaceship/milestones{/number}","notifications_url":"https://api.github.com/repos/fastlane/spaceship/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fastlane/spaceship/labels{/name}","releases_url":"https://api.github.com/repos/fastlane/spaceship/releases{/id}","created_at":"2015-04-11T19:44:23Z","updated_at":"2015-12-09T10:51:19Z","pushed_at":"2015-12-09T08:31:23Z","git_url":"git://github.com/fastlane/spaceship.git","ssh_url":"git@github.com:fastlane/spaceship.git","clone_url":"https://github.com/fastlane/spaceship.git","svn_url":"https://github.com/fastlane/spaceship","homepage":"https://spaceship.airforce","size":1646,"stargazers_count":616,"watchers_count":616,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":76,"mirror_url":null,"open_issues_count":55,"forks":76,"open_issues":55,"watchers":616,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fastlane/spaceship/pulls/192"},"html":{"href":"https://github.com/fastlane/spaceship/pull/192"},"issue":{"href":"https://api.github.com/repos/fastlane/spaceship/issues/192"},"comments":{"href":"https://api.github.com/repos/fastlane/spaceship/issues/192/comments"},"review_comments":{"href":"https://api.github.com/repos/fastlane/spaceship/pulls/192/comments"},"review_comment":{"href":"https://api.github.com/repos/fastlane/spaceship/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fastlane/spaceship/pulls/192/commits"},"statuses":{"href":"https://api.github.com/repos/fastlane/spaceship/statuses/d148d80dd63db7a5aaa8a2eb481ecb7b0b975269"}}}}