Skip to content

Commit

Permalink
fix access of undefined array index file
Browse files Browse the repository at this point in the history
  • Loading branch information
reinfi authored and Ocramius committed Dec 15, 2022
1 parent bfefcbc commit 7c1f50d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/EventLogging/EventContextProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ public function getEventTriggerFile()
{
$backtrace = $this->getDebugBacktrace();

if (! isset($backtrace[4]['file'])) {
return '';
}

if (file_exists($backtrace[4]['file'])) {
return basename(dirname($backtrace[4]['file'])) . '/' . basename($backtrace[4]['file']);
}
Expand Down

0 comments on commit 7c1f50d

Please sign in to comment.