Skip to content

Commit 277cb20

Browse files
mejo-backportbot[bot]
authored andcommitted
Always check for OCA.Files before using it (Fixes: #1106)
Signed-off-by: Jonas Meurer <[email protected]>
1 parent 05718f7 commit 277cb20

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/views/Viewer.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ export default {
326326
this.isLoaded = true
327327
328328
// bind Sidebar if available
329-
if (OCA.Files && OCA.Files.Sidebar) {
329+
if (OCA?.Files?.Sidebar) {
330330
this.Sidebar = OCA.Files.Sidebar.state
331331
}
332332
})
@@ -365,7 +365,7 @@ export default {
365365
this.cancelRequestFile()
366366
this.cancelRequestFolder()
367367
368-
if (OCA.Files.Sidebar) {
368+
if (OCA?.Files?.Sidebar) {
369369
OCA.Files.Sidebar.setFullScreenMode(true)
370370
}
371371
@@ -650,7 +650,7 @@ export default {
650650
// which then triggers cleanup.
651651
OCA.Viewer.close()
652652
653-
if (OCA.Files.Sidebar) {
653+
if (OCA?.Files?.Sidebar) {
654654
OCA.Files.Sidebar.setFullScreenMode(false)
655655
}
656656
},
@@ -739,7 +739,7 @@ export default {
739739
// Open the sidebar sharing tab
740740
// TODO: also hide figure, needs a proper method for it in server Sidebar
741741
742-
if (OCA.Files.Sidebar) {
742+
if (OCA?.Files?.Sidebar) {
743743
await OCA.Files.Sidebar.open(this.currentFile.filename)
744744
}
745745
},

0 commit comments

Comments
 (0)