Skip to content

Commit

Permalink
Better error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
drewm committed Apr 23, 2016
1 parent f533674 commit 590fb71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class Webhook
{
private static $eventSubscriptions = array();
private static $receivedWebhook = false;
private static $receivedWebhook = null;

/**
* Subscribe to an incoming webhook request. The callback will be invoked when a matching webhook is received.
Expand All @@ -35,7 +35,7 @@ public static function subscribe($event, callable $callback)
public static function receive($input = null)
{
if (is_null($input)) {
if (self::$receivedWebhook !== false) {
if (self::$receivedWebhook !== null) {
$input = self::$receivedWebhook;
} else {
$input = file_get_contents("php://input");
Expand Down

0 comments on commit 590fb71

Please sign in to comment.