summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKimmo Brunfeldt <kimmobrunfeldt@gmail.com>2014-07-07 01:00:46 +0300
committerKimmo Brunfeldt <kimmobrunfeldt@gmail.com>2014-07-07 01:00:46 +0300
commitad5bd72a440c1d379c218497dc55b189a295893d (patch)
treebeace824a52d8f501c42590794f4c4b2bc82cf7a
parent76b81bf1206618f69aef7079e537498d69cf66ed (diff)
downloadgit-hours-ad5bd72a440c1d379c218497dc55b189a295893d.zip
git-hours-ad5bd72a440c1d379c218497dc55b189a295893d.tar.gz
git-hours-ad5bd72a440c1d379c218497dc55b189a295893d.tar.bz2
Fix crash if commit author is not defined
-rwxr-xr-xindex.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/index.js b/index.js
index 511ab19..fe01e18 100755
--- a/index.js
+++ b/index.js
@@ -79,14 +79,19 @@ function commits(gitPath) {
var commits = [];
history.on("commit", function(commit) {
+ var author = null;
+ if (!_.isNull(commit.author())) {
+ author = {
+ name: commit.author().name(),
+ email: commit.author().email()
+ }
+ }
+
var commitData = {
sha: commit.sha(),
date: commit.date(),
message: commit.message(),
- author: {
- name: commit.author().name(),
- email: commit.author().email()
- }
+ author: author
};
commits.push(commitData);