From 272ba679ef4eae49640f53ec1041407e8861e339 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 16886e930fa2e..ae431e9595b46 100644 --- a/apps/files_sharing/lib/Controller/PublicPreviewController.php +++ b/apps/files_sharing/lib/Controller/PublicPreviewController.php @@ -131,7 +131,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); }