diff --git a/src/Monolog/Handler/Slack/SlackRecord.php b/src/Monolog/Handler/Slack/SlackRecord.php index cc8493c1..4b370b3b 100644 --- a/src/Monolog/Handler/Slack/SlackRecord.php +++ b/src/Monolog/Handler/Slack/SlackRecord.php @@ -216,10 +216,14 @@ class SlackRecord * Stringifies an array of key/value pairs to be used in attachment fields * * @param array $fields - * @return string + * @return string|null */ public function stringify($fields) { + if (!$this->lineFormatter) { + return null; + } + $string = ''; foreach ($fields as $var => $val) { $string .= $var.': '.$this->lineFormatter->stringify($val)." | ";