From c713febe7a43695e5e43762c188f5baf62282687 Mon Sep 17 00:00:00 2001 From: elias Date: Wed, 13 Mar 2019 11:21:58 -0500 Subject: [PATCH] let mark_document_with_no_blocked_loads() take a None value silently --- components/script/script_thread.rs | 12 +++++++----- 1 file 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)); + }} }) }