Skip to content

Commit af9acb9

Browse files
authored
Merge pull request #1109 from nextcloud/backport/1107/stable22
[stable22] Always check for `OCA.Files` before using it (Fixes: #1106)
2 parents 2a7c4f3 + f2be89a commit af9acb9

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

js/viewer-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/viewer-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/views/Viewer.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ export default {
325325
this.isLoaded = true
326326
327327
// bind Sidebar if available
328-
if (OCA.Files && OCA.Files.Sidebar) {
328+
if (OCA?.Files?.Sidebar) {
329329
this.Sidebar = OCA.Files.Sidebar.state
330330
}
331331
})
@@ -364,7 +364,7 @@ export default {
364364
this.cancelRequestFile()
365365
this.cancelRequestFolder()
366366
367-
if (OCA.Files.Sidebar) {
367+
if (OCA?.Files?.Sidebar) {
368368
OCA.Files.Sidebar.setFullScreenMode(true)
369369
}
370370
@@ -647,7 +647,7 @@ export default {
647647
// which then triggers cleanup.
648648
OCA.Viewer.close()
649649
650-
if (OCA.Files.Sidebar) {
650+
if (OCA?.Files?.Sidebar) {
651651
OCA.Files.Sidebar.setFullScreenMode(false)
652652
}
653653
},
@@ -735,7 +735,7 @@ export default {
735735
// Open the sidebar sharing tab
736736
// TODO: also hide figure, needs a proper method for it in server Sidebar
737737
738-
if (OCA.Files.Sidebar) {
738+
if (OCA?.Files?.Sidebar) {
739739
await OCA.Files.Sidebar.open(this.currentFile.filename)
740740
}
741741
},

0 commit comments

Comments
 (0)