From b2bcb6a124e24869f4ce16045ffb28054d7cb613 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Wed, 15 Mar 2023 09:49:55 +0100 Subject: [PATCH] Fix error handling for functions without arguments --- models/ErrorHandler.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/models/ErrorHandler.php b/models/ErrorHandler.php index 3139444a..74ca39c6 100644 --- a/models/ErrorHandler.php +++ b/models/ErrorHandler.php @@ -96,12 +96,15 @@ class ErrorHandler $object = isset($call['class']) ? $call['class'] . $call['type'] : ''; $args = []; - foreach ($call['args'] as $j => $arg) + if (isset($call['args'])) { - if (is_array($arg)) - $args[$j] = print_r($arg, true); - elseif (is_object($arg)) - $args[$j] = var_dump($arg); + foreach ($call['args'] as $j => $arg) + { + if (is_array($arg)) + $args[$j] = print_r($arg, true); + elseif (is_object($arg)) + $args[$j] = var_dump($arg); + } } $buffer .= '#' . str_pad($i, 3, ' ')