mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
return Option from GlobalScope::current
handles the case where GlobalScope::current calls CurrentGlobalOrNull and the result is null
This commit is contained in:
parent
dfc44a0d35
commit
433cd90bc3
4 changed files with 10 additions and 6 deletions
|
@ -586,7 +586,7 @@ impl WindowMethods for Window {
|
|||
};
|
||||
// Step 6.
|
||||
let container_doc = document_from_node(container);
|
||||
let current_doc = GlobalScope::current().as_window().Document();
|
||||
let current_doc = GlobalScope::current().expect("No current global object").as_window().Document();
|
||||
if !current_doc.origin().same_origin_domain(container_doc.origin()) {
|
||||
return None;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue