From de9012dc97544aa8d386b92ae6e7c34335f5aeed Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Wed, 29 Nov 2023 13:04:53 -0800 Subject: [PATCH] fix: viewer handler check ordering Fixes a crash due to accessing theme if handler is undefined. The check for null is right above it now Signed-off-by: Varun Patil --- src/views/Viewer.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/Viewer.vue b/src/views/Viewer.vue index aa1afd45b..075d720ff 100644 --- a/src/views/Viewer.vue +++ b/src/views/Viewer.vue @@ -660,7 +660,6 @@ export default { handler = this.registeredHandlers[mime] ?? this.registeredHandlers[alias] } - this.theme = handler.theme ?? 'dark' // if we don't have a handler for this mime, abort if (!handler) { logger.error('The following file could not be displayed', { fileInfo }) @@ -669,6 +668,7 @@ export default { return } + this.theme = handler.theme ?? 'dark' this.handlerId = handler.id // check if part of a group, if so retrieve full files list