diff --git a/src/Modifiers/CoreModifiers.php b/src/Modifiers/CoreModifiers.php index 24ab756c54..8c88173181 100644 --- a/src/Modifiers/CoreModifiers.php +++ b/src/Modifiers/CoreModifiers.php @@ -753,6 +753,10 @@ public function image($value, $params) */ public function joinplode($value, $params) { + if (is_null($value)) { + return ''; + } + // Workaround to support pipe characters. If there are multiple params // that means a pipe was used. We'll just join them for now. if (count($params) > 1) { diff --git a/tests/Modifiers/JoinTest.php b/tests/Modifiers/JoinTest.php new file mode 100644 index 0000000000..d3789a1cb8 --- /dev/null +++ b/tests/Modifiers/JoinTest.php @@ -0,0 +1,21 @@ +modify(null); + $this->assertEquals('', $joined); + } + + public function modify($arr, $delimiter = ' ') + { + return Modify::value($arr)->join($delimiter)->fetch(); + } +}