diff --git a/src/lib/Preview.js b/src/lib/Preview.js index 52d9c1b83..35e21ddbb 100644 --- a/src/lib/Preview.js +++ b/src/lib/Preview.js @@ -1042,7 +1042,7 @@ class Preview extends EventEmitter { const code = isFileTypeSupported ? ERROR_CODE.ACCOUNT : ERROR_CODE.UNSUPPORTED_FILE_TYPE; const message = isFileTypeSupported ? __('error_account') - : replacePlaceholders(__('error_unsupported'), [`.${this.file.extension}`]); + : replacePlaceholders(__('error_unsupported'), [(this.file.extension || '').toUpperCase()]); throw new PreviewError(code, message); } diff --git a/src/lib/__tests__/Preview-test.js b/src/lib/__tests__/Preview-test.js index 665e83c95..02c0e4f31 100644 --- a/src/lib/__tests__/Preview-test.js +++ b/src/lib/__tests__/Preview-test.js @@ -1507,7 +1507,7 @@ describe('lib/Preview', () => { preview.loadViewer(); } catch (e) { expect(e.message).to.equal( - util.replacePlaceholders(__('error_unsupported'), [`.${preview.file.extension}`]) + util.replacePlaceholders(__('error_unsupported'), ['ZIP']) ); } });