From 7ed84b35d971ebb5d30a56567e86137ab100dbab Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Wed, 26 Jan 2022 01:10:02 +0100 Subject: [PATCH] [fix] handle missing content-type --- ext/src/js/modules/file-download.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/src/js/modules/file-download.js b/ext/src/js/modules/file-download.js index 4c955bd..123c3f1 100644 --- a/ext/src/js/modules/file-download.js +++ b/ext/src/js/modules/file-download.js @@ -43,7 +43,7 @@ async function downloadFile(url) { } const contentType = responseObj.headers.get('Content-Type'); updateStatus(downloadStatus.DOWNLOADED); - if (contentType.toLowerCase().search('text') != -1) { + if (contentType && contentType.toLowerCase().search('text') != -1) { // TODO use charset of the response return await responseObj.text(); }