Don't return window proxy if it has been discarded

This commit is contained in:
Connor Brewster 2017-06-26 22:27:02 -07:00
parent 3f2d747689
commit 79f3237692
3 changed files with 11 additions and 16 deletions

View file

@ -406,7 +406,7 @@ impl Document {
#[inline]
pub fn browsing_context(&self) -> Option<Root<WindowProxy>> {
if self.has_browsing_context {
self.window.maybe_window_proxy()
self.window.undiscarded_window_proxy()
} else {
None
}