Skip to content

Commit aeb02af

Browse files
authored
Merge pull request #16 from Superbalist/fix-toarray-call-on-swift-mailer
ensure that toArray method actually exists on object when calling convertObjectToArray
2 parents 4b096f4 + a47dfe5 commit aeb02af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Engines/HandlebarsEngine.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ protected function evaluatePath($__path, $__data)
6363

6464
protected function convertObjectToArray($item)
6565
{
66-
if (is_object($item) && is_callable([$item, 'toArray'])) {
66+
if (is_object($item) && method_exists($item, 'toArray') && is_callable([$item, 'toArray'])) {
6767
$item = $item->toArray();
6868
}
6969

0 commit comments

Comments
 (0)