From 1ba646a19314fbaf5633c925e71269410610cb58 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 d917f6e0ebbb5..70c39315e3e2e 100644 --- a/apps/files_sharing/lib/Controller/PublicPreviewController.php +++ b/apps/files_sharing/lib/Controller/PublicPreviewController.php @@ -132,7 +132,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); }