let mark_document_with_no_blocked_loads() take a None value silently

This commit is contained in:
elias 2019-03-13 11:21:58 -05:00
parent d6b3eb6db9
commit c713febe7a

View file

@ -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));
}}
})
}