{"action":"created","comment":{"url":"https://api.github.com/repos/Strider-CD/strider-gitlab/pulls/comments/36311151","id":36311151,"diff_hunk":"@@ -30,7 +30,12 @@ module.exports = {\n     api.get(config, 'projects', function (err, repos) {\n       if (err) return done(err);\n \n-      repos = JSON.parse(repos);\n+      if(repos === null || repos === undefined) {","path":"lib/webapp.js","position":14,"original_position":14,"commit_id":"3213a9851d85ea62c1737b1feb50f7761be7540c","original_commit_id":"3213a9851d85ea62c1737b1feb50f7761be7540c","user":{"login":"saraf","id":117493,"avatar_url":"https://avatars.githubusercontent.com/u/117493?v=3","gravatar_id":"","url":"https://api.github.com/users/saraf","html_url":"https://github.com/saraf","followers_url":"https://api.github.com/users/saraf/followers","following_url":"https://api.github.com/users/saraf/following{/other_user}","gists_url":"https://api.github.com/users/saraf/gists{/gist_id}","starred_url":"https://api.github.com/users/saraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saraf/subscriptions","organizations_url":"https://api.github.com/users/saraf/orgs","repos_url":"https://api.github.com/users/saraf/repos","events_url":"https://api.github.com/users/saraf/events{/privacy}","received_events_url":"https://api.github.com/users/saraf/received_events","type":"User","site_admin":false},"body":"Yes, good. Should I amend the commit and create a new pull request, or add in a new commit to change that line?","created_at":"2015-08-05T14:57:14Z","updated_at":"2015-08-05T14:57:14Z","html_url":"https://github.com/Strider-CD/strider-gitlab/pull/24#discussion_r36311151","pull_request_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/Strider-CD/strider-gitlab/pulls/comments/36311151"},"html":{"href":"https://github.com/Strider-CD/strider-gitlab/pull/24#discussion_r36311151"},"pull_request":{"href":"https://api.github.com/repos/Strider-CD/strider-gitlab/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/Strider-CD/strider-gitlab/pulls/24","id":41641061,"html_url":"https://github.com/Strider-CD/strider-gitlab/pull/24","diff_url":"https://github.com/Strider-CD/strider-gitlab/pull/24.diff","patch_url":"https://github.com/Strider-CD/strider-gitlab/pull/24.patch","issue_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/issues/24","number":24,"state":"open","locked":false,"title":"Crash on receiving bad data when listing projects","user":{"login":"saraf","id":117493,"avatar_url":"https://avatars.githubusercontent.com/u/117493?v=3","gravatar_id":"","url":"https://api.github.com/users/saraf","html_url":"https://github.com/saraf","followers_url":"https://api.github.com/users/saraf/followers","following_url":"https://api.github.com/users/saraf/following{/other_user}","gists_url":"https://api.github.com/users/saraf/gists{/gist_id}","starred_url":"https://api.github.com/users/saraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saraf/subscriptions","organizations_url":"https://api.github.com/users/saraf/orgs","repos_url":"https://api.github.com/users/saraf/repos","events_url":"https://api.github.com/users/saraf/events{/privacy}","received_events_url":"https://api.github.com/users/saraf/received_events","type":"User","site_admin":false},"body":"When there was a problem in the gitlab configuration and\r\nan unreachable/incorrect hostname was specified, instead\r\nof JSON, we were getting undefined from the get\r\nmethod in api.js, and we were crashing.\r\n\r\nAdded an error message for this case so that we do not\r\ncrash.\r\n\r\nIdeally we should be checking for a valid reachable gitlab\r\nhost when saving the configuration.\r\n\r\nCrash trace below:\r\n\r\nSyntaxError: Unexpected token u\r\n\tat Object.parse (native)\r\n\tat /home/dev/sandbox/strider/node_modules/strider-gitlab/lib/webapp.js:34:20\r\n\tat /home/dev/sandbox/strider/node_modules/strider-gitlab/lib/api.js:45:16\r\n\tat Request.callback (/home/dev/sandbox/strider/node_modules/strider-gitlab/node_modules/superagent/lib/node/index.js:628:30)\r\n\tat ClientRequest.<anonymous> (/home/dev/sandbox/strider/node_modules/strider-gitlab/node_modules/superagent/lib/node/index.js:596:10)\r\n\tat ClientRequest.emit (events.js:107:17)\r\n\tat Socket.socketErrorListener (_http_client.js:271:9)\r\n\tat Socket.emit (events.js:107:17)\r\n\tat net.js:459:14\r\n\tat process._tickCallback (node.js:355:11)\r\n9284 died 1 null","created_at":"2015-08-05T03:45:57Z","updated_at":"2015-08-05T14:57:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fab918761f2cb2f9cce296a4d90e9d0b85a1c769","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/pulls/24/commits","review_comments_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/pulls/24/comments","review_comment_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/issues/24/comments","statuses_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/statuses/3213a9851d85ea62c1737b1feb50f7761be7540c","head":{"label":"saraf:master","ref":"master","sha":"3213a9851d85ea62c1737b1feb50f7761be7540c","user":{"login":"saraf","id":117493,"avatar_url":"https://avatars.githubusercontent.com/u/117493?v=3","gravatar_id":"","url":"https://api.github.com/users/saraf","html_url":"https://github.com/saraf","followers_url":"https://api.github.com/users/saraf/followers","following_url":"https://api.github.com/users/saraf/following{/other_user}","gists_url":"https://api.github.com/users/saraf/gists{/gist_id}","starred_url":"https://api.github.com/users/saraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saraf/subscriptions","organizations_url":"https://api.github.com/users/saraf/orgs","repos_url":"https://api.github.com/users/saraf/repos","events_url":"https://api.github.com/users/saraf/events{/privacy}","received_events_url":"https://api.github.com/users/saraf/received_events","type":"User","site_admin":false},"repo":{"id":40216825,"name":"strider-gitlab","full_name":"saraf/strider-gitlab","owner":{"login":"saraf","id":117493,"avatar_url":"https://avatars.githubusercontent.com/u/117493?v=3","gravatar_id":"","url":"https://api.github.com/users/saraf","html_url":"https://github.com/saraf","followers_url":"https://api.github.com/users/saraf/followers","following_url":"https://api.github.com/users/saraf/following{/other_user}","gists_url":"https://api.github.com/users/saraf/gists{/gist_id}","starred_url":"https://api.github.com/users/saraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saraf/subscriptions","organizations_url":"https://api.github.com/users/saraf/orgs","repos_url":"https://api.github.com/users/saraf/repos","events_url":"https://api.github.com/users/saraf/events{/privacy}","received_events_url":"https://api.github.com/users/saraf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/saraf/strider-gitlab","description":"Seamless integration between Strider and GitLab","fork":true,"url":"https://api.github.com/repos/saraf/strider-gitlab","forks_url":"https://api.github.com/repos/saraf/strider-gitlab/forks","keys_url":"https://api.github.com/repos/saraf/strider-gitlab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/saraf/strider-gitlab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/saraf/strider-gitlab/teams","hooks_url":"https://api.github.com/repos/saraf/strider-gitlab/hooks","issue_events_url":"https://api.github.com/repos/saraf/strider-gitlab/issues/events{/number}","events_url":"https://api.github.com/repos/saraf/strider-gitlab/events","assignees_url":"https://api.github.com/repos/saraf/strider-gitlab/assignees{/user}","branches_url":"https://api.github.com/repos/saraf/strider-gitlab/branches{/branch}","tags_url":"https://api.github.com/repos/saraf/strider-gitlab/tags","blobs_url":"https://api.github.com/repos/saraf/strider-gitlab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/saraf/strider-gitlab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/saraf/strider-gitlab/git/refs{/sha}","trees_url":"https://api.github.com/repos/saraf/strider-gitlab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/saraf/strider-gitlab/statuses/{sha}","languages_url":"https://api.github.com/repos/saraf/strider-gitlab/languages","stargazers_url":"https://api.github.com/repos/saraf/strider-gitlab/stargazers","contributors_url":"https://api.github.com/repos/saraf/strider-gitlab/contributors","subscribers_url":"https://api.github.com/repos/saraf/strider-gitlab/subscribers","subscription_url":"https://api.github.com/repos/saraf/strider-gitlab/subscription","commits_url":"https://api.github.com/repos/saraf/strider-gitlab/commits{/sha}","git_commits_url":"https://api.github.com/repos/saraf/strider-gitlab/git/commits{/sha}","comments_url":"https://api.github.com/repos/saraf/strider-gitlab/comments{/number}","issue_comment_url":"https://api.github.com/repos/saraf/strider-gitlab/issues/comments{/number}","contents_url":"https://api.github.com/repos/saraf/strider-gitlab/contents/{+path}","compare_url":"https://api.github.com/repos/saraf/strider-gitlab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/saraf/strider-gitlab/merges","archive_url":"https://api.github.com/repos/saraf/strider-gitlab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/saraf/strider-gitlab/downloads","issues_url":"https://api.github.com/repos/saraf/strider-gitlab/issues{/number}","pulls_url":"https://api.github.com/repos/saraf/strider-gitlab/pulls{/number}","milestones_url":"https://api.github.com/repos/saraf/strider-gitlab/milestones{/number}","notifications_url":"https://api.github.com/repos/saraf/strider-gitlab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/saraf/strider-gitlab/labels{/name}","releases_url":"https://api.github.com/repos/saraf/strider-gitlab/releases{/id}","created_at":"2015-08-05T01:02:10Z","updated_at":"2015-08-05T01:02:10Z","pushed_at":"2015-08-05T05:50:32Z","git_url":"git://github.com/saraf/strider-gitlab.git","ssh_url":"git@github.com:saraf/strider-gitlab.git","clone_url":"https://github.com/saraf/strider-gitlab.git","svn_url":"https://github.com/saraf/strider-gitlab","homepage":"","size":124,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"master"}},"base":{"label":"Strider-CD:master","ref":"master","sha":"492e40e14fb635f7fcd61dffe64675ff2bc6dae0","user":{"login":"Strider-CD","id":2199591,"avatar_url":"https://avatars.githubusercontent.com/u/2199591?v=3","gravatar_id":"","url":"https://api.github.com/users/Strider-CD","html_url":"https://github.com/Strider-CD","followers_url":"https://api.github.com/users/Strider-CD/followers","following_url":"https://api.github.com/users/Strider-CD/following{/other_user}","gists_url":"https://api.github.com/users/Strider-CD/gists{/gist_id}","starred_url":"https://api.github.com/users/Strider-CD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Strider-CD/subscriptions","organizations_url":"https://api.github.com/users/Strider-CD/orgs","repos_url":"https://api.github.com/users/Strider-CD/repos","events_url":"https://api.github.com/users/Strider-CD/events{/privacy}","received_events_url":"https://api.github.com/users/Strider-CD/received_events","type":"Organization","site_admin":false},"repo":{"id":19523050,"name":"strider-gitlab","full_name":"Strider-CD/strider-gitlab","owner":{"login":"Strider-CD","id":2199591,"avatar_url":"https://avatars.githubusercontent.com/u/2199591?v=3","gravatar_id":"","url":"https://api.github.com/users/Strider-CD","html_url":"https://github.com/Strider-CD","followers_url":"https://api.github.com/users/Strider-CD/followers","following_url":"https://api.github.com/users/Strider-CD/following{/other_user}","gists_url":"https://api.github.com/users/Strider-CD/gists{/gist_id}","starred_url":"https://api.github.com/users/Strider-CD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Strider-CD/subscriptions","organizations_url":"https://api.github.com/users/Strider-CD/orgs","repos_url":"https://api.github.com/users/Strider-CD/repos","events_url":"https://api.github.com/users/Strider-CD/events{/privacy}","received_events_url":"https://api.github.com/users/Strider-CD/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Strider-CD/strider-gitlab","description":"Seamless integration between Strider and GitLab","fork":true,"url":"https://api.github.com/repos/Strider-CD/strider-gitlab","forks_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/forks","keys_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/teams","hooks_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/hooks","issue_events_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/issues/events{/number}","events_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/events","assignees_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/assignees{/user}","branches_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/branches{/branch}","tags_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/tags","blobs_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/git/refs{/sha}","trees_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/statuses/{sha}","languages_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/languages","stargazers_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/stargazers","contributors_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/contributors","subscribers_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/subscribers","subscription_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/subscription","commits_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/commits{/sha}","git_commits_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/git/commits{/sha}","comments_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/comments{/number}","issue_comment_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/issues/comments{/number}","contents_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/contents/{+path}","compare_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/merges","archive_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/downloads","issues_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/issues{/number}","pulls_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/pulls{/number}","milestones_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/milestones{/number}","notifications_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/labels{/name}","releases_url":"https://api.github.com/repos/Strider-CD/strider-gitlab/releases{/id}","created_at":"2014-05-07T05:58:50Z","updated_at":"2015-07-25T21:59:37Z","pushed_at":"2015-08-05T05:50:32Z","git_url":"git://github.com/Strider-CD/strider-gitlab.git","ssh_url":"git@github.com:Strider-CD/strider-gitlab.git","clone_url":"https://github.com/Strider-CD/strider-gitlab.git","svn_url":"https://github.com/Strider-CD/strider-gitlab","homepage":"","size":269,"stargazers_count":10,"watchers_count":10,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":3,"forks":9,"open_issues":3,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Strider-CD/strider-gitlab/pulls/24"},"html":{"href":"https://github.com/Strider-CD/strider-gitlab/pull/24"},"issue":{"href":"https://api.github.com/repos/Strider-CD/strider-gitlab/issues/24"},"comments":{"href":"https://api.github.com/repos/Strider-CD/strider-gitlab/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/Strider-CD/strider-gitlab/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/Strider-CD/strider-gitlab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Strider-CD/strider-gitlab/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/Strider-CD/strider-gitlab/statuses/3213a9851d85ea62c1737b1feb50f7761be7540c"}}}}