mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Auto merge of #23187 - krk:nopanic-unminifyjs, r=jdm
Do not unwrap empty unminified_js_dir in HTMLScriptElement.unminify_js. Calling unwrap caused a panic when a directory could not be created. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #23031 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23187) <!-- Reviewable:end -->
This commit is contained in:
commit
a14b952fa3
1 changed files with 9 additions and 1 deletions
|
@ -555,7 +555,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!("Unminified script directory not found");
|
||||
return;
|
||||
},
|
||||
}
|
||||
|
||||
let path = if script.external {
|
||||
// External script.
|
||||
let path_parts = script.url.path_segments().unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue