Skip to content

Commit

Permalink
Merge pull request #32 from artonge/patch-1
Browse files Browse the repository at this point in the history
Default to an empty array when args is null
  • Loading branch information
icewind1991 committed Mar 18, 2024
2 parents 894783a + 37216ad commit f6177a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ExceptionSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private function filterTrace(array $trace) {
return $traceLine;
}, $trace);
return array_map(function (array $traceLine) use ($sensitiveValues) {
$traceLine['args'] = $this->removeValuesFromArgs($traceLine['args'], $sensitiveValues);
$traceLine['args'] = $this->removeValuesFromArgs($traceLine['args'] ?? [], $sensitiveValues);
return $traceLine;
}, $trace);
}
Expand All @@ -101,7 +101,7 @@ private function removeValuesFromArgs($args, $values) {
private function encodeTrace($trace) {
$filteredTrace = $this->filterTrace($trace);
return array_map(function (array $line) {
$line['args'] = array_map([$this, 'encodeArg'], $line['args']);
$line['args'] = array_map([$this, 'encodeArg'], $line['args'] ?? []);
return $line;
}, $filteredTrace);
}
Expand Down

0 comments on commit f6177a7

Please sign in to comment.