Skip to content

Commit

Permalink
[fix] handle missing content-type
Browse files Browse the repository at this point in the history
  • Loading branch information
asciimoo committed Jan 26, 2022
1 parent ee11bbe commit 7ed84b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/src/js/modules/file-download.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 7ed84b3

Please sign in to comment.