summaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorEric Biedert <github@ericbiedert.de>2024-10-07 10:13:09 +0200
committerGitHub <noreply@github.com>2024-10-07 08:13:09 +0000
commit20ce48dc36978e0995a03d7f97975deff99834b3 (patch)
tree1e8c6c5c48f1e1c19f49a8e4532fa4a268d2f3a0 /crates
parent60f9f66950f1fbef3d6042533e768b9ee933dd24 (diff)
Fix panic for empty breakable block equations (#5116)
Diffstat (limited to 'crates')
-rw-r--r--crates/typst/src/math/equation.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/typst/src/math/equation.rs b/crates/typst/src/math/equation.rs
index 83d3fc74..963a35c5 100644
--- a/crates/typst/src/math/equation.rs
+++ b/crates/typst/src/math/equation.rs
@@ -379,6 +379,12 @@ fn layout_equation_block(
equation_builder.size.y = height;
}
+ // Ensure that there is at least one frame, even for empty equations.
+ if equation_builders.is_empty() {
+ equation_builders
+ .push(MathRunFrameBuilder { frames: vec![], size: Size::zero() });
+ }
+
equation_builders
} else {
vec![full_equation_builder]