Do not unwrap empty unminified_js_dir in HTMLScriptElement.unminify_js.

This commit is contained in:
krk 2019-04-10 22:10:59 +02:00
parent dd2deeabca
commit 458795d485

View file

@ -556,7 +556,15 @@ impl HTMLScriptElement {
}, },
} }
let path = PathBuf::from(window_from_node(self).unminified_js_dir().unwrap()); let path;
match window_from_node(self).unminified_js_dir() {
Some(unminified_js_dir) => path = PathBuf::from(unminified_js_dir),
None => {
warn!("Could not store script directory not found");
return;
},
}
let path = if script.external { let path = if script.external {
// External script. // External script.
let path_parts = script.url.path_segments().unwrap(); let path_parts = script.url.path_segments().unwrap();