Skip to content

Commit

Permalink
Fix error when returning null
Browse files Browse the repository at this point in the history
  • Loading branch information
Rias committed May 21, 2018
1 parent 397a0d2 commit 82f022b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 1.0.1 - 2018-05-21
### Fixed
- Fixed an issue when returning `null` from `toTelegram()`

## 1.0.0 - 2018-01-23
### Added
- Initial release
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "rias/craft-telegram-notification-channel",
"description": "A Telegram notification channel for the Craft Notifications plugin",
"type": "craft-plugin",
"version": "1.0.0",
"version": "1.0.1",
"keywords": [
"craft",
"cms",
Expand Down
5 changes: 5 additions & 0 deletions src/models/TelegramChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public function send($notifiable, Notification $notification)
{
$message = $notification->toTelegram();

// If we don't get any message back, return.
if (is_null($message)) {
return;
}

if (is_string($message)) {
$message = TelegramMessage::create($message);
}
Expand Down

0 comments on commit 82f022b

Please sign in to comment.