From fcf449517ddff5d1b74f284c8c27166e105b9611 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 26 May 2015 21:17:04 -0400 Subject: [PATCH] handle case of deleted pipeline when preparing to send load_end constellation msg --- components/compositing/constellation.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs index bfcb0693c1e7..6b79722b7e4a 100644 --- a/components/compositing/constellation.rs +++ b/components/compositing/constellation.rs @@ -666,8 +666,8 @@ impl Constellation { } fn handle_load_start_msg(&mut self, pipeline_id: &PipelineId) { - let mut back = false; - let mut forward = false; + let mut back; + let mut forward; let frameid = self.pipeline_to_frame_map.get(pipeline_id); match frameid { Some(frame_id) => { @@ -676,13 +676,16 @@ impl Constellation { back = if !self.frame(*frame_id).prev.is_empty() { true } else { false }; }, - None => {} + None => return }; self.compositor_proxy.send(CompositorMsg::LoadStart(back, forward)); } fn handle_load_complete_msg(&mut self, pipeline_id: &PipelineId) { - let frame_id = *self.pipeline_to_frame_map.get(pipeline_id).unwrap(); + let frame_id = match self.pipeline_to_frame_map.get(pipeline_id) { + Some(frame) => *frame, + None => return + }; let forward = !self.mut_frame(frame_id).next.is_empty(); let back = !self.mut_frame(frame_id).prev.is_empty();