return Option from GlobalScope::current

handles the case where GlobalScope::current calls CurrentGlobalOrNull
and the result is null
This commit is contained in:
Jyotsna Prakash 2017-06-21 20:34:21 -07:00
parent dfc44a0d35
commit 433cd90bc3
4 changed files with 10 additions and 6 deletions

View file

@ -590,7 +590,7 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement {
Some(document) => document,
};
// Step 4.
let current = GlobalScope::current().as_window().Document();
let current = GlobalScope::current().expect("No current global object").as_window().Document();
if !current.origin().same_origin_domain(document.origin()) {
return None;
}