Skip to content

Commit

Permalink
Bridge: Nette\MemberAccessException may not throw only ObjectHelpers
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Dec 17, 2024
1 parent ef17b90 commit 61298f9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Bridges/Nette/Bridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ public static function renderMemberAccessException(?\Throwable $e): ?array
return null;
}

$loc = $e->getTrace()[$e instanceof Nette\MemberAccessException ? 1 : 0];
$trace = $e->getTrace();
do {
$loc = array_shift($trace);
} while (($loc['class'] ?? null) === Nette\Utils\ObjectHelpers::class);
if (!isset($loc['file'])) {
return null;
}
Expand Down

0 comments on commit 61298f9

Please sign in to comment.