Skip to content

Commit a70d0cc

Browse files
authored
Logging Handler fix
Checking if the exception in context is actually an object before attempting to get class of it.
1 parent 867dda0 commit a70d0cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/LogToDbCustomLoggingHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function __construct(array $config,
5555
protected function write(array $record): void
5656
{
5757
if (!empty($record)) {
58-
if (!empty($record['context']['exception']) &&
58+
if (!empty($record['context']['exception']) && is_object($record['context']['exception']) &&
5959
get_class($record['context']['exception']) === DBLogException::class) {
6060
//Do nothing if empty log record or an error Exception from itself.
6161
} else {
@@ -72,4 +72,4 @@ protected function write(array $record): void
7272
}
7373
}
7474
}
75-
}
75+
}

0 commit comments

Comments
 (0)