diff options
author | elias <elias.jm.garcia@gmail.com> | 2019-03-13 11:21:58 -0500 |
---|---|---|
committer | elias <elias.jm.garcia@gmail.com> | 2019-03-13 11:21:58 -0500 |
commit | c713febe7a43695e5e43762c188f5baf62282687 (patch) | |
tree | 53628ed81fb8df11bfe72eb158fde15d8c645ace /components/script/script_thread.rs | |
parent | d6b3eb6db9ab027a9a70eea24775f549abf8b025 (diff) | |
download | servo-c713febe7a43695e5e43762c188f5baf62282687.tar.gz servo-c713febe7a43695e5e43762c188f5baf62282687.zip |
let mark_document_with_no_blocked_loads() take a None value silently
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 9e20b09ef20..b3bd5b1c396 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -809,11 +809,13 @@ impl ScriptThread { pub fn mark_document_with_no_blocked_loads(doc: &Document) { SCRIPT_THREAD_ROOT.with(|root| { - let script_thread = unsafe { &*root.get().unwrap() }; - script_thread - .docs_with_no_blocking_loads - .borrow_mut() - .insert(Dom::from_ref(doc)); + unsafe { + if let Some(script_thread) = root.get() { + (*script_thread) + .docs_with_no_blocking_loads + .borrow_mut() + .insert(Dom::from_ref(doc)); + }} }) } |