Skip to content
This repository was archived by the owner on Nov 5, 2020. It is now read-only.

Commit 68b183d

Browse files
authored
bugfix for empy commit lists
fixes "Uncaught PHP Exception Symfony\Component\Debug\Exception\ContextErrorException: "Catchable Fatal Error: Argument 1 passed to DavidBadura\GitWebhooks\Provider\GithubProvider::createCommit() must be of the type array, null given, called in /var/www/simpspector/vendor/davidbadura/git-webhooks/src/Provider/GithubProvider.php on line 85 and defined" at /var/www/simpspector/vendor/davidbadura/git-webhooks/src/Provider/GithubProvider.php line 155"
1 parent f7da27c commit 68b183d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Provider/GithubProvider.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ private function createPushEvent($data)
8181
$event->repository = $this->createRepository($data['repository']);
8282
$event->commits = $this->createCommits($data['commits']);
8383

84-
if (!$event->commits) {
85-
$event->commits[] = $this->createCommit($data['head_commit']); // fix empty commits
84+
if (!$event->commits and $data['head_commit']) {
85+
$event->commits[] = $this->createCommit($data['head_commit']);
8686
}
8787

8888
$event->type = Util::getPushType($event->ref);

0 commit comments

Comments
 (0)