Fixed crash in commenter

dependabot/npm_and_yarn/BuildServer/eslint-7.2.0
Inga 🏳‍🌈 8 years ago
parent fed4b24322
commit 49f1574d44
  1. 14
      BuildServer/lib/commenter.ts

@ -37,11 +37,19 @@ const checkHasIssue = (options, issueNumber, callback) => options.github.issues.
owner: options.baseRepoOptions.owner,
repo: options.baseRepoOptions.reponame,
}, (getIssueErr, result) => {
if (getIssueErr && getIssueErr.code !== httpNotFound) {
return callback(getIssueErr);
if (getIssueErr) {
if (getIssueErr.code !== httpNotFound) {
return callback(getIssueErr);
}
return callback(null, false);
}
if (!result.number) {
return callback(`Unable to get issue info for ${options.baseRepoOptions.owner}/${options.baseRepoOptions.reponame}/#${issueNumber}: ${JSON.stringify(result)}`);
}
if (getIssueErr || result.number.toString() !== issueNumber) {
if (result.number.toString() !== issueNumber) {
return callback(null, false);
}

Loading…
Cancel
Save