Skip to content
This repository was archived by the owner on Nov 4, 2022. It is now read-only.

Commit

Permalink
Prevent stacktrace error
Browse files Browse the repository at this point in the history
  • Loading branch information
zenorocha committed Jun 4, 2013
1 parent 3803bc8 commit 8ad11e3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
14 changes: 12 additions & 2 deletions lib/cmds/issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,12 @@ Issue.prototype.close = function(opt_callback) {
var instance = this;

instance.getIssue_(function(err, issue) {
instance.editIssue_(issue.title, Issue.STATE_CLOSED, opt_callback);
if (err) {
opt_callback && opt_callback(err);
}
else {
instance.editIssue_(issue.title, Issue.STATE_CLOSED, opt_callback);
}
});
};

Expand Down Expand Up @@ -297,7 +302,12 @@ Issue.prototype.open = function(opt_callback) {
var instance = this;

instance.getIssue_(function(err, issue) {
instance.editIssue_(issue.title, Issue.STATE_OPEN, opt_callback);
if (err) {
opt_callback && opt_callback(err);
}
else {
instance.editIssue_(issue.title, Issue.STATE_OPEN, opt_callback);
}
});
};

Expand Down
9 changes: 7 additions & 2 deletions lib/cmds/pull-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,13 @@ PullRequest.prototype.open = function(opt_callback) {
var instance = this;

instance.getPullRequest_(function(err, pull) {
instance.updatePullRequest_(
pull.title, pull.body, PullRequest.STATE_OPEN, opt_callback);
if (err) {
opt_callback && opt_callback(err);
}
else {
instance.updatePullRequest_(
pull.title, pull.body, PullRequest.STATE_OPEN, opt_callback);
}
});
};

Expand Down

0 comments on commit 8ad11e3

Please sign in to comment.