Permalink
Browse files

Fixed issue with no commits found and throwing a JS error

  • Loading branch information...
1 parent 1a4693f commit 22981d7d93c677a75be2d3923d7d11c284bd5013 @davglass davglass committed Dec 27, 2012
Showing with 12 additions and 8 deletions.
  1. +12 −8 lib/cmds/cdn.js
View
@@ -82,14 +82,18 @@ mods = {
});
self.logs = logs;
var sha = logs[0];
- util.prompt('use commit [' + sha.sha.substr(0, 8) + ']? [Y/n] ', function(ans) {
- ans = ans.toLowerCase() || 'y';
- if (ans !== 'y') {
- self.askSha();
- return;
- }
- self.submit(sha.sha, sha.note);
- });
+ if (sha && sha.sha) {
+ util.prompt('use commit [' + sha.sha.substr(0, 8) + ']? [Y/n] ', function(ans) {
+ ans = ans.toLowerCase() || 'y';
+ if (ans !== 'y') {
+ self.askSha();
+ return;
+ }
+ self.submit(sha.sha, sha.note);
+ });
+ } else {
+ log.bail('failed to locate commits for this module');
+ }
});
});
},

0 comments on commit 22981d7

Please sign in to comment.