Skip to content

Commit

Permalink
Replace panic with warn in DocumentLoader.finish_load.
Browse files Browse the repository at this point in the history
Fix panic on broken script URL with an onerror handler that rewrites the
document.
  • Loading branch information
krk committed Apr 9, 2019
1 parent dd2deea commit 211fb00
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions components/script/document_loader.rs
Expand Up @@ -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 {
Expand Down

0 comments on commit 211fb00

Please sign in to comment.