Replace panic with warn in DocumentLoader.finish_load.

Fix panic on broken script URL with an onerror handler that rewrites the
document.
This commit is contained in:
krk 2019-04-09 21:02:03 +02:00
parent dd2deeabca
commit 211fb00574

View file

@ -167,8 +167,12 @@ impl DocumentLoader {
.blocking_loads
.iter()
.position(|unfinished| *unfinished == *load);
self.blocking_loads
.remove(idx.unwrap_or_else(|| panic!("unknown completed load {:?}", load)));
match idx {
Some(i) => {
self.blocking_loads.remove(i);
},
None => warn!("unknown completed load {:?}", load),
}
}
pub fn is_blocked(&self) -> bool {