Skip to content

Commit 43e47f1

Browse files
authored
Fix commits check, commits not always present
Fixes #76
1 parent 811194b commit 43e47f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/webhooks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function makeJob(project, config) {
4747

4848
function startFromCommit(project, payload, send) {
4949
var config = pushJob(payload);
50-
var lastCommit = payload.commits[payload.commits.length - 1];
50+
var lastCommit = payload.commits ? payload.commits[payload.commits.length - 1] : false;
5151

5252
if (!lastCommit) {
5353
lastCommit = {};

0 commit comments

Comments
 (0)