diff options
Diffstat (limited to 'crates/typst-cli/src')
| -rw-r--r-- | crates/typst-cli/src/world.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/typst-cli/src/world.rs b/crates/typst-cli/src/world.rs index 12e80d27..2da03d4d 100644 --- a/crates/typst-cli/src/world.rs +++ b/crates/typst-cli/src/world.rs @@ -210,7 +210,9 @@ impl World for SystemWorld { } fn font(&self, index: usize) -> Option<Font> { - self.fonts[index].get() + // comemo's validation may invoke this function with an invalid index. This is + // impossible in typst-cli but possible if a custom tool mutates the fonts. + self.fonts.get(index)?.get() } fn today(&self, offset: Option<i64>) -> Option<Datetime> { |
