diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 12e99e6d3857..35b6c8133b64 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -1350,10 +1350,9 @@ impl IOCompositor { Some(root_pipeline_id) => root_pipeline_id, None => return, }; - let root_pipeline = match self.pipeline(root_pipeline_id) { - Some(root_pipeline) => root_pipeline, - None => return, - }; + if self.pipeline(root_pipeline_id).is_none() { + return; + } let (translated_point, translated_pipeline_id) = webrender_api.translate_point_to_layer_space(&point.to_untyped()); @@ -1395,10 +1394,9 @@ impl IOCompositor { Some(root_pipeline_id) => root_pipeline_id, None => return, }; - let root_pipeline = match self.pipeline(root_pipeline_id) { - Some(root_pipeline) => root_pipeline, - None => return, - }; + if self.pipeline(root_pipeline_id).is_none() { + return; + } let (translated_point, translated_pipeline_id) = webrender_api.translate_point_to_layer_space(&cursor.to_untyped());