Skip to content

Commit 7c9fb7b

Browse files
solracsfbackportbot[bot]
authored andcommitted
fix(PublicPreview): Call getMimetype() on File objects
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
1 parent d4b4863 commit 7c9fb7b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

apps/files_sharing/lib/Controller/PublicPreviewController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function getPreview(
132132
return $response;
133133
} catch (NotFoundException $e) {
134134
// If we have no preview enabled, we can redirect to the mime icon if any
135-
if ($mimeFallback) {
135+
if ($file instanceof \OCP\Files\File && $mimeFallback) {
136136
if ($url = $this->mimeIconProvider->getMimeIconUrl($file->getMimeType())) {
137137
return new RedirectResponse($url);
138138
}

0 commit comments

Comments
 (0)