Skip to content

Commit 5f39f46

Browse files
committed
Don't expect HTML element with ID mimetype in public share
If the share is password-protected, the authentication page doesn't have the property set yet. Fixes: #3816 Signed-off-by: Jonas <[email protected]>
1 parent 0fe5d70 commit 5f39f46

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/public.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ const loadEditor = ({ sharingToken, mimetype, $el }) => {
4848
}
4949

5050
documentReady(() => {
51-
const mimetype = document.getElementById('mimetype').value
5251
const sharingToken = document.getElementById('sharingToken') ? document.getElementById('sharingToken').value : null
5352

5453
if (!sharingToken) {
@@ -66,7 +65,8 @@ documentReady(() => {
6665
}
6766

6867
// single file share
69-
if (openMimetypes.indexOf(mimetype) !== -1) {
68+
const mimetype = document.getElementById('mimetype')?.value
69+
if (mimetype && openMimetypes.indexOf(mimetype) !== -1) {
7070
loadEditor({ mimetype, sharingToken, $el: document.getElementById('preview') })
7171
}
7272
})

0 commit comments

Comments
 (0)