diff --git a/lib/Cake/View/Elements/exception_stack_trace.ctp b/lib/Cake/View/Elements/exception_stack_trace.ctp index be016757a..219bf28c4 100644 --- a/lib/Cake/View/Elements/exception_stack_trace.ctp +++ b/lib/Cake/View/Elements/exception_stack_trace.ctp @@ -41,10 +41,12 @@ App::uses('Debugger', 'Utility'); echo ' → '; if ($stack['function']): $args = array(); - foreach ($stack['args'] as $arg): - $args[] = Debugger::getType($arg); - $params[] = Debugger::exportVar($arg, 2); - endforeach; + if (!empty($stack['args'])): + foreach ((array)$stack['args'] as $arg): + $args[] = Debugger::getType($arg); + $params[] = Debugger::exportVar($arg, 2); + endforeach; + endif; $called = isset($stack['class']) ? $stack['class'] . $stack['type'] . $stack['function'] : $stack['function'];