Skip to content

Commit

Permalink
#251 Add more coverage and guard for empty commitObj.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmeijer committed Mar 18, 2015
1 parent 4477a93 commit d056cfd
Show file tree
Hide file tree
Showing 2 changed files with 246 additions and 45 deletions.
9 changes: 7 additions & 2 deletions src/common/util/opencontext.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,13 @@ define(['util/assert', 'common/core/core'], function (ASSERT, Core) {
function _loadCommitHash(parameters, result, gmeConfig, callback) {
var core;
result.project.loadObject(result.commitHash, function (err, commitObj) {
if (err) {
callback(err);
if (err || !commitObj) {
if (commitObj) {
callback(err);
} else {
callback('No such commitHash "' + result.commitHash + '", in project "' +
parameters.projectName + '".');
}
return;
}
core = parameters.core || new Core(result.project, {globConf: gmeConfig});
Expand Down
Loading

0 comments on commit d056cfd

Please sign in to comment.