From dd224654e8039df9f2b9b02ee5dccb68cda8d443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 8 Jul 2020 14:13:45 +0200 Subject: Properly handle cases where the fileList could not be fetched MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/view/FilesAppIntegration.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/view/FilesAppIntegration.js b/src/view/FilesAppIntegration.js index 53a53497..5fd1d6ff 100644 --- a/src/view/FilesAppIntegration.js +++ b/src/view/FilesAppIntegration.js @@ -62,8 +62,8 @@ export default { if (typeof this.getFileList() !== 'undefined') { this.getFileModel() - this.getFileList().hideMask() - this.getFileList().setPageTitle(this.fileName) + this.getFileList().hideMask && this.getFileList().hideMask() + this.getFileList().setPageTitle && this.getFileList().setPageTitle(this.fileName) } const headerRight = document.querySelector('#header .header-right') @@ -224,6 +224,10 @@ export default { }, _addHeaderFileActions() { + if (!this.getFileList().$el) { + console.error('[FilesAppIntegration] Failed to register file actions due to missing $el dependency') + return + } console.debug('[FilesAppIntegration] Adding header file actions') OC.unregisterMenu($('#richdocuments-actions .icon-more'), $('#richdocuments-actions-menu')) $('#richdocuments-actions').remove() -- cgit v1.2.3