Skip to content

Commit 58423f2

Browse files
committed
Fix for addon crash when DB::disableQueryLog() was called in a user application
1 parent 94945bb commit 58423f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/LaravelDebugbar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ function ($level, $message, $context) use ($logger) {
251251
}
252252
}
253253

254-
if ($this->shouldCollect('db', true) && isset($this->app['db'])) {
254+
if ($this->shouldCollect('db', true) && isset($this->app['db']) && $this->app['db']->logging()) {
255255
$db = $this->app['db'];
256256
if ($debugbar->hasCollector('time') && $this->app['config']->get(
257257
'debugbar.options.db.timeline',

0 commit comments

Comments
 (0)