Skip to content

Commit 83ab663

Browse files
Merge pull request #62977 from nextcloud/backport/56196/stable33
[stable33] fix(PublicPreview): Call getMimetype() on File objects
2 parents 39f8147 + 7c9fb7b commit 83ab663

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)