Fix detection of method to use to fetch url in downloadFile function

This commit is contained in:
Ethan O'Brien 2024-12-21 15:16:59 -06:00
parent 35639bb896
commit a4e4aef907

View File

@ -109,7 +109,7 @@ class EmulatorJS {
}
let url;
try {url=new URL(path)}catch(e){};
if (!url || !['http:', 'https:'].includes(url.protocol)) {
if (url && !['http:', 'https:'].includes(url.protocol)) {
//Most commonly blob: urls. Not sure what else it could be
if (opts.method === 'HEAD') {
cb({headers:{}});