File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,14 +51,19 @@ export default {
5151 if (! this .file || ! this .file .shareAttributes ) {
5252 return true
5353 }
54-
55- const shareAttributes = JSON .parse (this .file .shareAttributes )
56- const downloadPermissions = shareAttributes .find (({ scope, key }) => scope === ' permissions' && key === ' download' )
57- if (downloadPermissions) {
58- return downloadPermissions .value
54+ try {
55+ const shareAttributes = JSON .parse (this .file .shareAttributes )
56+ const downloadPermissions = shareAttributes .find (({ scope, key }) => scope === ' permissions' && key === ' download' )
57+ if (downloadPermissions) {
58+ return downloadPermissions .value
59+ }
60+ return true
61+ } catch (e) {
62+ logger .error (' Error parsing shareAttributes:' , e)
63+ // If shareAttributes can not be parsed, assume the file is
64+ // downloadable to avoid locking users out of their files.
65+ return true
5966 }
60-
61- return true
6267 },
6368
6469 isRichDocumentsAvailable () {
You can’t perform that action at this time.
0 commit comments