diff options
author | Kimmo Brunfeldt <kimmobrunfeldt@gmail.com> | 2014-07-07 01:00:46 +0300 |
---|---|---|
committer | Kimmo Brunfeldt <kimmobrunfeldt@gmail.com> | 2014-07-07 01:00:46 +0300 |
commit | ad5bd72a440c1d379c218497dc55b189a295893d (patch) | |
tree | beace824a52d8f501c42590794f4c4b2bc82cf7a | |
parent | 76b81bf1206618f69aef7079e537498d69cf66ed (diff) | |
download | git-hours-ad5bd72a440c1d379c218497dc55b189a295893d.zip git-hours-ad5bd72a440c1d379c218497dc55b189a295893d.tar.gz git-hours-ad5bd72a440c1d379c218497dc55b189a295893d.tar.bz2 |
Fix crash if commit author is not defined
-rwxr-xr-x | index.js | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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); |