diff --git a/lib/index.js b/lib/index.js index 42c74a5..c550851 100644 --- a/lib/index.js +++ b/lib/index.js @@ -43,11 +43,10 @@ module.exports = { repo.getData(function (err) { if (err) throw err; - repo.spook(); + repo.spook(callback); }); }); return this; } - } \ No newline at end of file diff --git a/lib/repo.js b/lib/repo.js index 1ef2fe0..0963c0a 100644 --- a/lib/repo.js +++ b/lib/repo.js @@ -95,6 +95,7 @@ Repo.prototype.spook = function (callback) { }.bind(this), function () { template.render('events/test-summary', total) + callback(); }); } @@ -153,7 +154,7 @@ Repo.prototype.getIssues = function (callback) { github.getIssues(this.data.owner.login, this.data.name, function (err, issues) { if (err) return callback(err); - if (!issues[0].pull_request) { + if (!issues[0] || !issues[0].pull_request) { issues = []; }