Permalink
Browse files

Fixed warnings in stack trace element when no stack args are set.

  • Loading branch information...
Thomas Ploch
Thomas Ploch committed Mar 9, 2012
1 parent 2c55c7c commit cc9b445eceb4bfdb5cebd1e5269e1d6b98c318b6
Showing with 6 additions and 4 deletions.
  1. +6 −4 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'];

0 comments on commit cc9b445

Please sign in to comment.