aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/document_loader.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-04-11 14:33:44 -0400
committerGitHub <noreply@github.com>2019-04-11 14:33:44 -0400
commitdb9300d3e6cedf3f2ccce3b608020a586d540ef7 (patch)
tree06fff21eedc891f38e081a96aaa252e0be55288b /components/script/document_loader.rs
parent9ab0af01fe2618d81555f0c2bea3585c0f468628 (diff)
parent211fb00574d41bb262d7a6bc6accc5ab149545c9 (diff)
downloadservo-db9300d3e6cedf3f2ccce3b608020a586d540ef7.tar.gz
servo-db9300d3e6cedf3f2ccce3b608020a586d540ef7.zip
Auto merge of #23183 - krk:fix-23144, r=asajeffrey
Replace panic with warn in DocumentLoader.finish_load. Fix panic on broken script URL with an onerror handler that rewrites the document. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #23144 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23183) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/document_loader.rs')
-rw-r--r--components/script/document_loader.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/components/script/document_loader.rs b/components/script/document_loader.rs
index d127d78ebd2..ef4075d6599 100644
--- a/components/script/document_loader.rs
+++ b/components/script/document_loader.rs
@@ -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 {