Skip to content

Commit

Permalink
ExceptionTraceCleaner: fixed empty stack traces when xdebug is enable…
Browse files Browse the repository at this point in the history
…d, but not in develop mode
  • Loading branch information
dktapps committed Aug 25, 2022
1 parent 07363ff commit 85b4e5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/ExceptionTraceCleaner.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public function __construct(string $mainPath){
*/
public function getTrace($start = 0, $trace = null){
if($trace === null){
if(function_exists("xdebug_get_function_stack")){
$trace = array_reverse(xdebug_get_function_stack());
if(function_exists("xdebug_get_function_stack") && count($trace = @xdebug_get_function_stack()) !== 0){
$trace = array_reverse($trace);
}else{
$e = new \Exception();
$trace = $e->getTrace();
Expand Down

0 comments on commit 85b4e5c

Please sign in to comment.