From e1074b04568df81398eb3306c0bd5cdede79355c Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Tue, 4 Nov 2025 18:33:46 +0100 Subject: [PATCH] fix(PublicPreview): Call getMimetype() on File objects Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- apps/files_sharing/lib/Controller/PublicPreviewController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files_sharing/lib/Controller/PublicPreviewController.php b/apps/files_sharing/lib/Controller/PublicPreviewController.php index f4015a02f4a43..d0495bb43ee43 100644 --- a/apps/files_sharing/lib/Controller/PublicPreviewController.php +++ b/apps/files_sharing/lib/Controller/PublicPreviewController.php @@ -136,7 +136,7 @@ public function getPreview( return $response; } catch (NotFoundException $e) { // If we have no preview enabled, we can redirect to the mime icon if any - if ($mimeFallback) { + if ($file instanceof \OCP\Files\File && $mimeFallback) { if ($url = $this->mimeIconProvider->getMimeIconUrl($file->getMimeType())) { return new RedirectResponse($url); }