Skip to content

Commit 17ba722

Browse files
Merge pull request #62978 from nextcloud/backport/56196/stable31
[stable31] fix(PublicPreview): Call getMimetype() on File objects
2 parents 36804e7 + 272ba67 commit 17ba722

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
@@ -131,7 +131,7 @@ public function getPreview(
131131
return $response;
132132
} catch (NotFoundException $e) {
133133
// If we have no preview enabled, we can redirect to the mime icon if any
134-
if ($mimeFallback) {
134+
if ($file instanceof \OCP\Files\File && $mimeFallback) {
135135
if ($url = $this->mimeIconProvider->getMimeIconUrl($file->getMimeType())) {
136136
return new RedirectResponse($url);
137137
}

0 commit comments

Comments
 (0)