Skip to content

Commit

Permalink
Check file (#599)
Browse files Browse the repository at this point in the history
* Check file

* Check line
  • Loading branch information
barryvdh authored Feb 15, 2024
1 parent 512fb06 commit 484625c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DebugBar/DataCollector/MessagesCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function addMessage($message, $label = 'info', $isString = true)
$stacktrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 5);
$stackItem = $stacktrace[0];
foreach ($stacktrace as $trace) {
if (strpos($trace['file'], '/vendor/') !== false) {
if (!isset($trace['file']) || strpos($trace['file'], '/vendor/') !== false) {
continue;
}

Expand All @@ -85,7 +85,7 @@ public function addMessage($message, $label = 'info', $isString = true)
'is_string' => $isString,
'label' => $label,
'time' => microtime(true),
'xdebug_link' => $stackItem ? $this->getXdebugLink($stackItem['file'], $stackItem['line']) : null,
'xdebug_link' => $stackItem ? $this->getXdebugLink($stackItem['file'], $stackItem['line'] ?? null) : null,
);
}

Expand Down

0 comments on commit 484625c

Please sign in to comment.