From c93afe23aafc2b4bcd7ed5d4f4bcc280a5b658c0 Mon Sep 17 00:00:00 2001 From: Cilibiu Bogdan Date: Tue, 19 Mar 2019 09:13:12 +0200 Subject: [PATCH] assert file extension validity first (#1025) --- projects/adf-office-services-ext/src/lib/evaluators.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/adf-office-services-ext/src/lib/evaluators.ts b/projects/adf-office-services-ext/src/lib/evaluators.ts index 3a8dd0dce..037df5851 100644 --- a/projects/adf-office-services-ext/src/lib/evaluators.ts +++ b/projects/adf-office-services-ext/src/lib/evaluators.ts @@ -30,6 +30,11 @@ export function canOpenWithOffice( return false; } + const extension = getFileExtension(file.entry.name); + if (!extension || !supportedExtensions[extension]) { + return false; + } + // workaround for Shared files if ( context.navigation && @@ -51,11 +56,6 @@ export function canOpenWithOffice( return false; } - const extension = getFileExtension(file.entry.name); - if (!extension || !supportedExtensions[extension]) { - return false; - } - /* if (file.entry && file.entry.aspectNames) { const checkedOut = file.entry.aspectNames.find(