Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(recording): replace unwrap with error propagation in CreateTexture2D

Richie McIlroybdf3ff5f97fc
diff --git a/crates/recording/src/output_pipeline/win.rs b/crates/recording/src/output_pipeline/win.rs
index 12aa5bcf8..5de5ee31e 100644
--- a/crates/recording/src/output_pipeline/win.rs
+++ b/crates/recording/src/output_pipeline/win.rs
@@ -1713,6 +1713,6 @@ pub fn upload_mf_buffer_to_texture(
unsafe {
let mut texture = None;
device.CreateTexture2D(&texture_desc, Some(&subresource_data), Some(&mut texture))?;
- Ok(texture.unwrap())
+ texture.ok_or_else(|| anyhow!("CreateTexture2D succeeded but returned no texture"))
}
}