Skip to content

Commit 4b7a5b2

Browse files
committed
Fix profiler in prod env
1 parent 77b9133 commit 4b7a5b2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Controller/DAVController.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,12 @@ private function initExceptionListener()
291291
}
292292

293293
#[Route('/dav/{path}', name: 'dav', requirements: ['path' => '.*'])]
294-
public function dav(Request $request, Profiler $profiler, string $path)
294+
public function dav(Request $request, ?Profiler $profiler = null, ?string $path)
295295
{
296296
// We don't want the toolbar on the /dav/* routes
297-
$profiler->disable();
297+
if ($profiler instanceof Profiler) {
298+
$profiler->disable();
299+
}
298300

299301
// We need to acknowledge the OPTIONS call before sabre/dav for public
300302
// calendars since we're circumventing the lib

0 commit comments

Comments
 (0)