From 4b55b578b29520b5a01b6b6eb5b19718459d899b Mon Sep 17 00:00:00 2001 From: Keith Simmons Date: Wed, 13 Apr 2022 14:57:16 -0700 Subject: [PATCH] Don't panic when allocating tiny_skia pixmap --- crates/gpui/src/platform/mac/sprite_cache.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/gpui/src/platform/mac/sprite_cache.rs b/crates/gpui/src/platform/mac/sprite_cache.rs index a93df3b187..ceeb06698c 100644 --- a/crates/gpui/src/platform/mac/sprite_cache.rs +++ b/crates/gpui/src/platform/mac/sprite_cache.rs @@ -143,7 +143,7 @@ impl SpriteCache { }) { Entry::Occupied(entry) => Some(entry.get().clone()), Entry::Vacant(entry) => { - let mut pixmap = tiny_skia::Pixmap::new(size.x() as u32, size.y() as u32).unwrap(); + let mut pixmap = tiny_skia::Pixmap::new(size.x() as u32, size.y() as u32)?; resvg::render(&svg, usvg::FitTo::Width(size.x() as u32), pixmap.as_mut()); let mask = pixmap .pixels()