Skip to content

Commit

Permalink
Add PHP 7.2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
mpociot committed Dec 1, 2017
1 parent b2f5ed2 commit 9e2ac1c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ language: php
php:
- 7.0
- 7.1
- 7.2

before_script:
- travis_retry composer self-update --preview
Expand Down
2 changes: 1 addition & 1 deletion src/FacebookDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ public function buildServicePayload($message, $matchingMessage, $additionalParam
$parameters['message'] = $message->toArray();
} elseif ($message instanceof OutgoingMessage) {
$attachment = $message->getAttachment();
if (in_array(get_class($attachment), $this->supportedAttachments)) {
if (!is_null($attachment) && in_array(get_class($attachment), $this->supportedAttachments)) {
$attachmentType = strtolower(basename(str_replace('\\', '/', get_class($attachment))));
unset($parameters['message']['text']);
$parameters['message']['attachment'] = [
Expand Down

0 comments on commit 9e2ac1c

Please sign in to comment.