From 24087db62f7a10eb285b326cb7df31674e430f42 Mon Sep 17 00:00:00 2001 From: Laurenz Stampfl <47084093+LaurenzV@users.noreply.github.com> Date: Sat, 14 Dec 2024 22:42:44 +0100 Subject: [PATCH] Fix panic --- crates/typst-pdf/src/krilla.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/typst-pdf/src/krilla.rs b/crates/typst-pdf/src/krilla.rs index fabc5afef..82cc5a187 100644 --- a/crates/typst-pdf/src/krilla.rs +++ b/crates/typst-pdf/src/krilla.rs @@ -344,9 +344,9 @@ pub fn handle_shape( path_builder.line_to(l.x.to_f32(), l.y.to_f32()); } Geometry::Rect(r) => { - path_builder.push_rect( - Rect::from_xywh(0.0, 0.0, r.x.to_f32(), r.y.to_f32()).unwrap(), - ); + if let Some(r) = Rect::from_xywh(0.0, 0.0, r.x.to_f32(), r.y.to_f32()) { + path_builder.push_rect(r); + } } Geometry::Path(p) => { convert_path(p, &mut path_builder);