mirror of
https://github.com/servo/servo.git
synced 2025-06-21 07:38:59 +01:00
Use Result instead of panicking when the resource dir can't be found
This commit is contained in:
parent
20b1764d71
commit
ceb85795b1
11 changed files with 81 additions and 64 deletions
|
@ -24,9 +24,12 @@ pub fn load_script(head: &HTMLHeadElement) {
|
|||
let doc = doc.r();
|
||||
|
||||
let path = if &**path_str == "" {
|
||||
let mut p = resources_dir_path();
|
||||
p.push("user-agent-js");
|
||||
p
|
||||
if let Ok(mut p) = resources_dir_path() {
|
||||
p.push("user-agent-js");
|
||||
p
|
||||
} else {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
PathBuf::from(path_str)
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue