From: Michael Wallner Date: Wed, 9 Mar 2016 15:45:13 +0000 (+0100) Subject: fix response if no action is to be taken X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=8189a52ebb8f7663aabfdbd1a3ff931db9553495;p=pharext%2Fpharext.org fix response if no action is to be taken --- diff --git a/app/Controller/Github/Hook/Receive.php b/app/Controller/Github/Hook/Receive.php index 9bc1323..1094fd2 100644 --- a/app/Controller/Github/Hook/Receive.php +++ b/app/Controller/Github/Hook/Receive.php @@ -51,12 +51,14 @@ class Receive implements Controller case "create": case "release": if (($json = json_decode($request->getBody()))) { - $this->$evt($json)->done(function($result) use($response) { - list($created) = $result; - $response->setResponseCode(201); - $response->setHeader("Location", $created->url); - }); - $this->github->drain(); + if (($queue = $this->$evt($json))) { + $queue->done(function($result) use($response) { + list($created) = $result; + $response->setResponseCode(201); + $response->setHeader("Location", $created->url); + }); + $this->github->drain(); + } } else { $response->setResponseCode(415); $response->setContentType($request->getHeader("Content-Type"));